[code]
.
.
.
infile.open("infile.txt"ios::in)// [color=green]right after this i need it to input 6 numbers now what exactly do i use out of the following..
infile>> a;
infile>> b;(and so on)
OR
infile.get(a);
infile.get(b);
infile.get©; and so on... now.. are these close or totally wrong?
here is how im trying to use it
{
cout<<"Would you like to play the disc game?";
cin.get (ans,4);
if(strcmp(ans, "yes" )==0)
beef:
{cout<<"Would you like to input from a file? y for yes n for no
";
cin>>ansa;
switch(ansa)
{
case 'y':
infile.open("Finalinput.txt", ios::in);
cout<<"infile opend
";
info();
break;
case 'n':
info();
break;
default:
cout<<"Please enter the correct answer
";
goto beef;
break;
}
}
else if(strcmp(ans,"no" )==0)
cout<<"thank you for visiting....."<<endl;
else
cout<<"Please follow directions!
";
}
void info()
{
cout<<"Please type Coefficients and constants a, b, c, d, e, f!";
cin>>a
>>b//i need it to input a number for each variabl
>>c
>>d
>>e
>>f;
calculate(a, b, c, d, e, f);
}
im looking at a book right now that shows both methods but neither seem to work. If you can help, DONT GIVE ME ANSWERS JUST ADVICE OR GUIDENCE PLEASE! thank you, i will appreciate it a lot thanks! or, if you need more info tell me thanks!
(Edited by EnKRYpTeD at 11:25 pm on May 15, 2001)

New Topic/Question
Reply




MultiQuote





|