redhat
Mad and Furious
I am new to programming in C++, just now I tried to create an array with 'n' index'es where n is an input no. This is what i coded:
But, VC++ 6.0, returns, the following errors:
Please help... how do i create such an array??
This syntax used to work in Java
Code:
#include<iostream>
using namespace std;
int main()
{
int n=10,m;
cin >> n >> m;
int stor[n];
return(0);
}
But, VC++ 6.0, returns, the following errors:
Compiling...
Cpp2.cpp
C:\Documents and Settings\Darshit Shah\C++\Euler\IOI\Cpp2.cpp(8) : error C2057: expected constant expression
C:\Documents and Settings\Darshit Shah\C++\Euler\IOI\Cpp2.cpp(8) : error C2466: cannot allocate an array of constant size 0
C:\Documents and Settings\Darshit Shah\C++\Euler\IOI\Cpp2.cpp(8) : error C2133: 'stor' : unknown size
Error executing cl.exe.
Please help... how do i create such an array??
This syntax used to work in Java