|

楼主 |
发表于 2004-5-29 23:41:57
|
显示全部楼层
最初由 _z_ 发表
应该不是吧
这段代码用Dev-C++编译通过:
再好好想想~~~:confused:
也许我的这个推测不对,但是:
这个没法通过编译
- #include <iostream>
- #include <stdlib.h>
- #include <sstream>
- #include <fstream>
- using namespace std;
- int main(int argc, char *argv[])
- {
- char buff[1024];
- istringstream iss(string(buff));
- int a;
- iss >> a;
- system("PAUSE");
- return 0;
- }
复制代码
- 这个却是可以的:
- #include <iostream>
- #include <stdlib.h>
- #include <sstream>
- #include <fstream>
- using namespace std;
- int main(int argc, char *argv[])
- {
- char buff[1024];
- string str(buff);
- istringstream iss (str);
- int a;
- iss >> a;
- system("PAUSE");
- return 0;
- }
复制代码
我也是使用dev-cpp编译的。
你的代码我没有编译,估计是可以的,因为在这之前我自己也做过测试。发现不是我说的那个原因。 |
|