Hi
I was trying to check what arrays are initialized to by default. In my case for the code below the string array was initialized to white spaces because this is what I got. Would you please tell me what arrays (C-strings are also arrays) are initialized to by default. Thanks for the help.
Code:// learning_arrays_strings.cpp // intializtion of an array #include <iostream> #include <cstdlib> #include <cstring> using namespace std; const int C = 5; char str[C]; int main() { int i; for (i=0; i<C; i++) { cout << str[i]; } cout << endl; system("pause"); return 0; }



1Likes
LinkBack URL
About LinkBacks




