G****A 发帖数: 4160 | 1 如果想从一个.txt 文件读一些数据,windows下面c++ code 如下: |
E*V 发帖数: 17544 | 2 what kind of compiler did you use?
no problem here
【在 G****A 的大作中提到】 : 如果想从一个.txt 文件读一些数据,windows下面c++ code 如下:
|
E*V 发帖数: 17544 | 3 btw, my gcc version is 4.4.1
【在 E*V 的大作中提到】 : what kind of compiler did you use? : no problem here
|
G****A 发帖数: 4160 | 4 gcc 4.1.2 (redhat 4.1.2)
【在 E*V 的大作中提到】 : what kind of compiler did you use? : no problem here
|
t**********r 发帖数: 26 | 5
~~~~~~~~~~~~~path?
【在 G****A 的大作中提到】 : 如果想从一个.txt 文件读一些数据,windows下面c++ code 如下:
|
G****A 发帖数: 4160 | 6 error: no match for operation >>? in input_demand>>a>>b>>c
【在 G****A 的大作中提到】 : 如果想从一个.txt 文件读一些数据,windows下面c++ code 如下:
|
G****A 发帖数: 4160 | 7 我把目标文件(graph.txt)放在 .c 文件同样的路径下。
ifstream input_graph("/graph.txt", ios:in);
这样的设置有问题么??
【在 E*V 的大作中提到】 : what kind of compiler did you use? : no problem here
|
E*V 发帖数: 17544 | 8 ft, i know what you did now.
you should use a .cc file, not .c
or use .cpp,
use "g++ your.cc"
not "gcc your.c"
【在 G****A 的大作中提到】 : 我把目标文件(graph.txt)放在 .c 文件同样的路径下。 : ifstream input_graph("/graph.txt", ios:in); : 这样的设置有问题么??
|
|
G****A 发帖数: 4160 | 9 我之前的文件是.c, 用g++编译。只要去掉
while(input_graph>>a>>b>>c)
编译通过。所以我觉得可能不是这个问题。
【在 E*V 的大作中提到】 : ft, i know what you did now. : you should use a .cc file, not .c : or use .cpp, : use "g++ your.cc" : not "gcc your.c"
|
m*********g 发帖数: 273 | 10 do you know the difference between gcc and g++? |
a*****i 发帖数: 4391 | 11 Listen to EUV.
I also think that is most likely where the error is from. |
J*******i 发帖数: 2162 | 12 using namespace std;
试试这个? |