string str;
str.printf("PRN:%d ,Elevation:%d ,Azimuth:%d ,Strength:%d; ",
m_PRN,m_Elevation,m_Azimuth,m_Strength);
提示struct std::string has no member named printf
string类里没有printf()这个方法,printf()是C++标准库里面函数,直接调用就可以了
printf()
直接写,不要加前缀。你现在变成了string.printf()
,string没有这样的成员。
可以参考哈这两篇文章http://blog.csdn.net/ssihc0/article/details/5189119和
http://blog.csdn.net/nowhaha/article/details/38710571
string 类没有printf这个函数所以编译器会提示你错误。格式化字符串可以用sprintf或Format方法