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

How does c++ structure differ from c++ class?

856


What's the order in which the local objects are destructed?

1036


What are c++ storage classes?

821


What are the types of array in c++?

836


What are guid? Why does com need guids?

815


Write a program using display() function which takes two arguments.

851


Write a program which uses functions like strcmp(), strcpy()? etc

873


If a function doesn’t return a value, how do you declare the function?

833


What is the disadvantage of using a macro?

826


Which software is best for c++ programming?

801


Can comments be longer than one line?

829


What are static type checking?

835


Write a function to find the nth item from the end of a linked list in a single pass.

774


What is static in c++?

830


Why is c++ called oops?

824