printf 不能打印string 理论上讲不通,string是类,printf()只能打印基本类型。应该用 string s; cout << s; 或 printf("%s", s.c_str());