What is the default value, variables are assigned when they are not initialized? In the below code, i have not initialized variables - count and j however, i am getting different values. Won't all variables be assigned default value zero?Unable to understand.
#include<iostream>
#include<sstream>
using namespace std;
int main()
{
char str[] ("Hello World!!!");
char *p;
int i;
int count;
int j;
cout << "count is:" << count << endl;
cout <<"Value of j is " << j <<endl;
p=str;
for (i=0;i<20;i++){
cout << *p;
p++;
}
cout << "Length of string is:" << count <<endl;
}
o/p
count is:4198400 Value of j is:1 Hello World!!! Length of string is:4198400