J
John
Is this a valid C++ program that will not crash on any machine?
#include <iostream>
using namespace std;
int main( void ) {
int i;
cin >> i;
double X;
X[i-1] = 1123;
cout << X[i-1] << endl;
return 0;
}
What does the standard say about defining and initializing arrays of
length
non-const? Is it illegal? Or is that legal in C++?
Thanks,
--j
#include <iostream>
using namespace std;
int main( void ) {
int i;
cin >> i;
double X;
X[i-1] = 1123;
cout << X[i-1] << endl;
return 0;
}
What does the standard say about defining and initializing arrays of
length
non-const? Is it illegal? Or is that legal in C++?
Thanks,
--j