O
omidsoltan
Hello, I am new to c++ and have a very simple question.
Why when reading a char array the whole array is displayed for
example
char st[] = " hello " ;
cout << st << endl ;
will then display the whole array.
but if you use an int array e.g
int num [] = {1,2,3};
cout << num ;
will display the address of the first number;
the second example makes sense since num is really &num[0], I dont
understand why the same isn't the case for the first example.
Thanks everybody....
Why when reading a char array the whole array is displayed for
example
char st[] = " hello " ;
cout << st << endl ;
will then display the whole array.
but if you use an int array e.g
int num [] = {1,2,3};
cout << num ;
will display the address of the first number;
the second example makes sense since num is really &num[0], I dont
understand why the same isn't the case for the first example.
Thanks everybody....