| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 480 人关注过本帖
标题:不知道怎么修改
只看楼主 加入收藏
xizong
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2007-1-23
收藏
 问题点数:0 回复次数:5 
不知道怎么修改
错误提示说:first use this function  请问我应该怎么修改好呢。当第一次使用函数的时候要注意些什么呢。!
搜索更多相关主题的帖子: function 
2007-02-01 18:09
monkeyzhen
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2007-1-27
收藏
得分:0 
是没有定义么?
2007-02-01 20:39
虫虫飞ya飞
Rank: 1
等 级:新手上路
帖 子:122
专家分:0
注 册:2005-11-28
收藏
得分:0 
你就这个提示不好说撒,把代码贴上看下.

2007-02-06 16:31
xizong
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2007-1-23
收藏
得分:0 

using namespace std;

int main(){
vector<string> names;
string const endinput("END");
cout << "type '" << endinput << "' when there are no more names.\n\n";
for( int finished(0); finished != 1; ){
cout << "type in the next name; ";
string fullname;
getline( cin, fullname );
if( endinput == fullname )
finished = 1;
else
names.push_back( fullname ) ;
}
sort( names.begin(), names.end());
ofstresam outfile("name.txt");
for( int i(0); i != names.size(); ++i ){
cout << names[i] << '\n';
outfile << names[i] << '\n';
}
}

2007-02-07 19:28
lehmann
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2006-8-15
收藏
得分:0 

实在看不懂你的错误是什么意思
我就改了一下
#include <vector>
#include <iostream>
#include <string>
#include <algorithm>
#include <fstream>

using namespace std;

int main(){
vector<string> names;
const string endinput("END");
cout << "type '" << endinput << "' when there are no more names.\n\n";
for( int finished(0); finished != 1; ){
cout << "type in the next name; ";
string fullname;
getline( cin, fullname );
if( endinput == fullname )
finished = 1;
else
names.push_back( fullname ) ;
}
sort( names.begin(), names.end());
ofstream outfile("name.txt");
for( int i(0); i != names.size(); ++i ){
cout << names[i] << '\n';
outfile << names[i] << '\n';
}
}
这里面可能还有问题,不知道改的对不对

2007-03-11 22:45
dick_zq007
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2006-12-5
收藏
得分:0 
没有定义头文件吧你~~

-------------------不再浪费一秒钟---------------------
2007-03-13 16:23
快速回复:不知道怎么修改
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011917 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved