I dont understand a line of code that Bucky writes in tutorial 66.
using namespace std;
cout<<"Enter players ID, Name and account"<<endl;
cout<<"Press Cntrl + Z to quit"<<endl;
fobj<<"ID "<<"LastName "<<"FirstName "<<"Balance"<<endl;
while(cin>>id>>lname>>fname>>money) //What does this line mean?//
fobj <<id<<" "<<lname<<" "<<fname<<" "<<money<<endl;
The line of code is while(cin>>id>>lname>>fname>>money)
What does this mean?
C++ Tutorial 66 Concept Problem
Post a Reply
|Oldest Newest Rating|
· July 20, 2014
Yup kroothusas is correct. The while loop with input (which is cin) as a conditional means that the loop will continue as long as the input is correct. It will only terminate if the user put an incorrect type or the user entered/reach the EOF (End-of-File) which is Ctrl+Z
Used in many types of software including music players, video games, and many large scale applications.
|Bucky Roberts Administrator|