• Register

Questions by amna

0 votes
1 answer 23 views
Hello, I'm looking for a random function in C / C ++: the random () function of C ++ returns a value between 0 and X but I would need a function like: random (4,5,7,9) which would return either 4 or 5 or 7 or 9. I don't know if it exists and that's why I'm asking. thank you
asked Aug 6, 2020
0 votes
1 answer 90 views
I need to find the index of a number in the vector in C ++, particularly the minimum of the same array. I want to do the same as, for example, in Python, it does the .index () method on a python list, but with a vector in C ++. Example in python of what I want to do in C ++: arr.index (min (arr))
asked Aug 6, 2020
0 votes
1 answer 55 views
I have this program to work with a doubly-linked list in C ++. What goes wrong is the end delete function, which as its name implies would have to remove the end node from the list with its contents, but instead it does display memory addresses. How can I fix the error? #include <iostream> #include ... CAB) { cout << endl << "" <<AUX-> n << "was removed from the list"; CAB = NULL; } getchar (); }
asked Aug 6, 2020
0 votes
1 answer 17 views
Hello, Beginner in C++, I created a small program for myself as an exercise, but I am stuck when calculating the sum of the elements of my array, Could you tell me a method to get there, again thank you all! here is my program: int tab [10]; int i = 0; for (i = 0; i <= 9; i ... the value N °% ld", i); scanf ("% ld", tab [i]); } then I will want to add up my 10 elements and there I block. Thank you
asked Aug 6, 2020