New Posts  All Forums:Forum Nav:

C++ coding help

post #1 of 2
Thread Starter 
I want to write a program that reads a number from the user, then prompts the user that many times to enter a value. However, I want it to put the value into a diferant variable each time. How would I go about doing this?
post #2 of 2
create a class named value and put in the constructor a variable called whatever and make it equals to the argument (which is the entered value from the user).
you'll get the number from user
then make a for loop depending on that number
and create a pointer object of the class with the loop number as a label and the new value as an argument.
This will create each time an object called Value[1],[2],........etc and put each value in an object.
Shady
(11 items)
 
  
CPUMotherboardGraphicsRAM
Intel(R) Core(TM) i7-4790K MSI Z97 GAMING 7 (MS-7916)  XFX Radeon R9 295X2 HyperX 32GB 
Hard DriveOSMonitorKeyboard
Kingston SSDNow V300 Series (RAID0) Windows 8.1 Pro Samsung ua40hu7000rxzn (40" UHD) Logitech G105 
PowerCaseMouse
EVGA 850B Corsair Carbide Series Black 500R Mid Tower Logitech G502 
  hide details  
Reply
Shady
(11 items)
 
  
CPUMotherboardGraphicsRAM
Intel(R) Core(TM) i7-4790K MSI Z97 GAMING 7 (MS-7916)  XFX Radeon R9 295X2 HyperX 32GB 
Hard DriveOSMonitorKeyboard
Kingston SSDNow V300 Series (RAID0) Windows 8.1 Pro Samsung ua40hu7000rxzn (40" UHD) Logitech G105 
PowerCaseMouse
EVGA 850B Corsair Carbide Series Black 500R Mid Tower Logitech G502 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Application Programming