int main()
{
int i ,a[i];
i = 0;
a[i] = 10;
cout<< a[i] << endl;
return 0;


}

What will be output of this program?

Answer Posted / vikas

Index variable of any array should be integer constant.
but in this case i is not constant so it is a error

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a wchar_t in c++?

587


What is the best c++ book?

714


How const int *ourpointer differs from int const *ourpointer?

612


What is the array and initializing arrays in c++?

510


How do you show the declaration of a virtual constructor?

534






What is problem with overriding functions?

611


What is rtti in c++?

629


Is swift a good first language?

592


Which operator cannot overload?

545


What are friend functions in C++?

624


What is nested class in c++?

522


What is function overloading in C++?

737


What is c++ coding?

660


Write a short code using c++ to print out all odd number from 1 to 100 using a for loop

588


Where are setjmp and longjmp used in c++?

626