0

Initially, array declared with zero. Still, the compiler is not throwing error.

int x_var[0];
cout<<"Hello World"<<x_var[0]<<endl; // <<<<<<<<<<<< prints random number

x_var[0]=1;                          // >>>>> compiler is not throwing error.
                                     // But initialized array as zero.It must throw error
cout<<"Hello World"<<x_var[0]<<endl; // <<<<<<<<<<<<Prints value 1
Support Ukraine
  • 42,271
  • 4
  • 38
  • 63
Manju
  • 73
  • 5

0 Answers0