【小白提问】怎么输出sizeof(vector<int>)
c4droid吧
全部回复
仅看楼主
level 5
sizeof (vector<int>)那一行为何编译器提示错误?按理说语法没错吧?编译器说要俩参数[疑问]
2017年02月17日 12点02分 1
level 5
前面也using过了vector
2017年02月17日 12点02分 2
level 14
你先把问题简化,看看图中的代码能不能编译
2017年02月17日 15点02分 4
谢谢大佬!我发现是因为没有include vector头文件[狂汗]见笑了。。。不过也没include string头文件,sizeof(string)却成功输出了,不懂为何。。。只include了iostream(莫非iostream里头有include string)。。。
2017年02月17日 16点02分
@下GV去自首 因为cout支持输出string啊,所以就会包含string
2017年02月18日 04点02分
@不知者来此 啊,原来如此[真棒]!那是不是include iostream的程序就都不用再include string了?
2017年02月18日 05点02分
2017年02月18日 05点02分
1