Why is extra content printed on the first array?
But the second array works correctly.
Thanks
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include<iostream>
usingnamespace std;
int main()
{
//char secondString[] = { 'D', 'A','N','I' }; // it has a problem abd print other things
char secondString[] = { "DANI" }; // it work
for (char * cp = secondString; * cp ; cp++)
{
cout << (*cp);
}
return 0;
}