Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C++ Project, need all the help i can get!
#3
Okay thanks! I have a question on reading in the data from the fileĀ… as you can see from above, Option A and Option B both have two floodlights with given measurements. But Option C has three floodlights all with random values. how should I read the measurements in? Right now i have

Code:
    lights >> option >> num_floodlights >> given_or_random >> measurement_1 >> measurement_2 >> measurement_3 >> measurement_4 >> power >> height;

But as soon as it loops around for the last option, C, my data reading in will get messed up..

could i do this?:
Code:
while(option !=C)
lights >> option >> num_floodlights >> given_or_random >> measurement_1 >> measurement_2 >> measurement_3 >> measurement_4 >> power >> height;

then do all the calculations and stuff in there then do a separate while loop for option C, like:
Code:
while(option=C)
lights >> option >> num_floodlights >> given_or_random >> power >> height;
Reply


Messages In This Thread
C++ Project, need all the help i can get! - by InvictHero - 2014-05-01, 03:56 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)