Thanks Got help

TheoPetro

Banned
Nov 30, 2004
3,499
1
0
alright this is just a piece of the code. I think the problem is happening when I assing V___ = ____ so VOne=One for example. When I test this and put in random inputs I get an output for V___ of whatever arbitrary number the compiler puts in there. Is this assignment not legal or something?

#include <iostream>
using namespace std;


int main()
{

// Declares a dummy variable that may be altered

double VOne = 0, VTwo = 0, VThree = 0,
VFour = 0, VFive = 0, VSix = 0,
VSeven = 0, VEight = 0, VNine = 0;

// Declares all variables that will not be changed in the program

double One, Two, Three,
Four, Five, Six,
Seven, Eight, Nine;

//Declares the sum variables

double SOne, STwo, SThree, SFour, SFive, SSix, SSeven;

//Input the vlaues of the variables

cin >> One, Two, Three,
Four, Five, Six,
Seven, Eight, Nine;

// Sets the dummy variable to the value of the first input variable.

VOne = One;

// Checks to see if the input stream is done by checking if the input is zero

if (VOne != 0)
{
cout << VOne;
VOne = 0;
}
else
cout << "";

VTwo = (Two);

if (VTwo != 0)
{
cout << VTwo;
VTwo = 0;
}
else
cout << "";
 

Kirby

Lifer
Apr 10, 2006
12,028
2
0
perhaps?

cin >> One>>Two>>Three>>Four>> Five>>Six>>Seven>>Eight>>Nine;
 

TheoPetro

Banned
Nov 30, 2004
3,499
1
0
Originally posted by: nkgreen
perhaps?

cin >> One>>Two>>Three>>Four>> Five>>Six>>Seven>>Eight>>Nine;

holy ass that was it. I feel kinda dumb right now. Guess thats what I get for doin it at 4am. THanks
 

Kirby

Lifer
Apr 10, 2006
12,028
2
0
Originally posted by: TheoPetro
Originally posted by: nkgreen
perhaps?

cin >> One>>Two>>Three>>Four>> Five>>Six>>Seven>>Eight>>Nine;

holy ass that was it. I feel kinda dumb right now. Guess thats what I get for doin it at 4am. THanks

as many times as atot has saved my ass on this kinda stuff......