View Full Version : I need help with a C++ program
Wei Wu Wei
Dec 2nd, 2002, 07:07:46 PM
I know someone out there in message board land can help me out. I need to put x amount of values into an array. I can't figure out how to initialize an array that will store as many values as I want it to. Any ideas? Thank you for your help! I really do appreciate whatever help I can get.
Nathanial K'cansce
Dec 2nd, 2002, 08:48:46 PM
Do you know what x ='s?
If it changes, then I'd say use this notation...
ArrayName[x];
where x = some other variable that will be defined within the program.
Wei Wu Wei
Dec 2nd, 2002, 09:17:24 PM
I'll see how that works. Thanks much, Snack.
Taataani Meorrrei
Dec 2nd, 2002, 09:18:12 PM
Yep, that'll do it. Just adjust your I/O correctly.
For example:
cout << "How many numbers do you want to enter?" << endl;
cin >> x;
x=x--;
Nathanial K'cansce
Dec 2nd, 2002, 09:36:23 PM
Welcome. :)
vBulletin, 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.