int myArray[80];
void setGenerateRandNum()
{
srand(time(NULL));
int randX;
for (int i = 0; i <= getN2(); i++)
{
randX = rand() % getN2() + 1;
std::cout << randX << " ";
myArray[i] = randX;//I want to store my values in myArray butw when ı print out my array ı get some oktadecimal numbers where is the problem ??
}
You do realize the code you showed doesn't show you printing your array, right? How would we know what is wrong?
Also, it's not "oktadecimal" (18?), it's hexadecimal (16).
This is how you print out an array:
1 2 3 4 5
for (int i = 0; i < getN2(); i++)
{
std::cout << myArray[i] << " ";
}
std::cout << "\n";
Doing std::cout << myArray; just prints the value of the pointer (a memory address).