   string != oprator
  when I use string name; name != ""  vc tell me c2678 error but I google it and string offer the != why I can not use it ??   
  BTW if I want to detect if it == "" ,could I use:name.size()==0  or name.emtpy()??   ;  Use the length member function of the string class.if(name.lenth()==0);  Odds are you forgot to #include <string>And yes, you could use name.empty();   ;Quote:Original post by xDS4LxUse the length member function of the string class.if(name.lenth()==0)what is different between length() and size()?   ;  Both length() and size() do the same by returning the number of elements in a string.   