0
Someone please help me !!
int main () { int loop, number [5]; cout << “Insert 5 number” << endl; for (loop = 0; loop < 5; loop++) { cin >> number [loop]; } cout << number << endl; } Why the program not showing my 5 number that i insert ? Its show 0x22fe30
3 Respostas
0
Because arrays are actually pointers to the memory location.
To print all of it, you should use a for loop:
for (let i = 0; i < 5; i++)
cout << *(number + i) << endl;
0
you have to use loop to print the results as well cause it is in array
for(int loop=0; loop<5; loop++)
{
cout<<number[loop]<<endl;
}
just remove "cout<<number;" it's wrong...
0
thank youuu 🙂