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
What is vectorial capacity?
What is difference between malloc()/free() and new/delete?
What is using namespace std in cpp?
What are the operators in c++?
What is anonymous object in c++?
How to declare a pointer to an array of integers?
When do we use copy constructors?
How do you clear a set in c++?
Am studying basic c++ programming, have been given the following assignment. Design a linear program to calculate the maximum stress a material can withstand given a force and a diameter of a circle. To find the required area pi should be defined. Have most of the program sorted out but am at a loss as to how to show the calculations required. Can anyone help?
What is the difference between a reference and a pointer?
Is c++ the hardest programming language?
Why c++ is not a pure oop language?
What is the difference between the parameter to a template and the parameter to a function?
What is implicit pointer in c++?
Explain the use of vtable.