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 / ramesh kumar

in array we can must enter size integer...
not as variable type like i
thats why it gives an error

Is This Answer Correct ?    9 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is c++ an integer?

585


What is virtual destructor? What is its use?

581


What is difference between array and vector in c++?

566


What are the three forms of cin.get() and what are their differences?

638


Can we distribute function templates and class templates in object libraries?

597






I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.

616


Which function cannot be overloaded c++?

583


How is modularity introduced in C++?

774


Which programming language is best?

558


What is constructor in C++?

636


What is the use of "new" operator?

667


How did c++ start?

622


Can we use pointers in c++?

622


How is c++ different from java?

567


Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

625