in c++, what does for ( ; ; ) do?
I thought for loop at least require a conditional statement?
example of the code would be...
//code starts here
void Huffman::buildDecodingTree(ifstream & codeIn)
{
char ch; // a character
string code; // its code
for ( ; ; )
{
codeIn >> ch >> code;
if ( codeIn.eof() ) return;
insert(ch, code);
}
}
so what exactly is for ( ; ; ) doing in this snippet of code?
thank you for your help.
I thought for loop at least require a conditional statement?
example of the code would be...
//code starts here
void Huffman::buildDecodingTree(ifstream & codeIn)
{
char ch; // a character
string code; // its code
for ( ; ; )
{
codeIn >> ch >> code;
if ( codeIn.eof() ) return;
insert(ch, code);
}
}
so what exactly is for ( ; ; ) doing in this snippet of code?
thank you for your help.