boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Linux版 - 问个c++的问题哈。
相关主题
CentOS 5.5自带的python版本过低,能自己升级吗?
怎样创造一个 segv (转载)
OpenOffice without X
GCC在哪里用?
关于 gcc 和 g++ 的问题 (转载)
about dcmtk (转载)
怎样用vim编译java
运行一个软件说 缺glibc_2.0, 如何解决?
值得在嵌入式中直接使用gcc吗?
新手问个 服务器问题
相关话题的讨论汇总
话题: path话题: gcc话题: c++话题: use话题: input
进入Linux版参与讨论
1 (共1页)
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;
试试这个?
1 (共1页)
进入Linux版参与讨论
相关主题
新手问个 服务器问题
再问个iptables rule的安全性问题
请教一个基础C++问题 (转载)
弱问编译器是executable吗?
about compiling new glibc/gcc in fc14
请教用yum 更新redhat 问题
两个物理硬盘,用硬raid还是软raid?
做个调查。大家都用什么linux distro?
请问我应该安装哪个linux的dist?
哪一个distro可以在winxp下面安装?
相关话题的讨论汇总
话题: path话题: gcc话题: c++话题: use话题: input