I learned the basics of C++ few months ago. Recently I found a while loop that looks like this. I want to understand how it works.
while(cin>>n>>m,n||m)
{
does something;
}
operator , (operator comma)
executes all instructions in list and returns value of last expression, so cin>>n>>m,n||m
is equal to
cin >> n >> m;
n || m;
And whole loop will work like this one:
int n, m;
cin >> n >> m;
while(n || m){
//some action
cin >> n >> m;
}