#include <iostream>
#include <string>
usingnamespace std;
int main(){
int x, n=0, artqty[n];
int artcode[n];
cout << "enter the amount sperate items you wish you order" <<endl;
cin >>x;
while (n < x)
{
cout <<"please enter art code" <<endl;
cin >> artcode[n];
cout <<"enter the amount you wish to order" <<endl;
cin >> artqty[n] ;
n++;
};
for( n = 0; n<x; n++ ){
cout << "artcode : " << artcode[n] <<" quantity" << artcode[n] << endl;
}
system("pause");
return 0;
}
But if i change the artcode[n] into string type, the program seem to be unresponsive, anyone know why? Is it because the size of string is undefined and error occur when the array size increase?