返回信息流如下,用visual2005进行调试, 没看明白错误的内容? 是程序的问题还是2005哪里的编译设置我弄错了?
程序:
#include<iostream>
#include<string>
using namespace std;
//解析一行字符串,从中找出第一个英文字符串
int main()
{
string in;
cin>>in;
string target="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; //定义字符集
int first=in.find_first_of(target);
if(first==string::npos) cout<<"can't find any characters"<<endl;
int second=in.find(' ',first);
if(second==string::npos) cout<<"can't find any characters"<<endl;
string str=in.substr(first,second-first+1); //取出第一个英文词
cout<<str<<endl;
return 0;
}
这是一条镜像帖。来源:北邮人论坛 / cpp / #8588同步于 2008/6/19
该镜像源已超过 30 天没有更新,可能在源站已被删除。
CPP机器人发帖
请教达人关于string一个程序,
lblz
2008/6/19镜像同步6 回复
订阅后,新回复会通过你的通知中心匿名送达。
6 条回复
报错说"系统找不到string.exe"
错误信息如下:
------ 已启动生成: 项目: string, 配置: Debug Win32 ------
正在编译...
cl : Command line error D8016 : '/MT' and '/clr' command-line options are incompatible
生成日志保存在“file://d:\C++ project\string\string\Debug\BuildLog.htm”
string - 1 个错误,0 个警告
========== 生成: 0 已成功, 1 已失败, 0 最新, 0 已跳过 ==========
【 在 ericyosho 的大作中提到: 】
: GCC下编译顺利通过,程序语法上没有什么问题。
: 你的错误信息告诉你,你不能同时选择/MT和/CLR选项。
谢了哈
ps:汗,我来查下/MT是什么?