How do I check if a StringStream variable is empty/null?

前端 未结 8 878
粉色の甜心
粉色の甜心 2020-12-13 08:32

Just a quick question here guys. I\'ve been searching to no avail so far.

A bit more info here:

stringstream report_string;

report_string << \         


        
8条回答
  •  余生分开走
    2020-12-13 09:21

    Use eof() instead.

    Sample Code:

    stringstream report_string;
    if ( !(report_string.eof()) ) 
        cout << "report_string EMPTY! \n";
    

提交回复
热议问题