getoutdo 2015-06-22 00:57 采纳率: 0%
浏览 2068

c++问题 指向字符串的指针

#include "stdafx.h"
#include
#include
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
char *s = "Hello";
char *t = "World";
int i = strcmp(s, t);
if (i > 0)
cout << "s>t" << endl;
else if (i < 0)
cout << "s<t" << endl;
else
cout << "s=t" << endl;
int j = strlen(s);
cout << endl;
cout << "字符串s的长度为:" << j << endl;
return 0;
}
Error 2 error C2001: newline in constant 22 1

Error 3 error C2143: syntax error : missing ';' before 'return' 23 1
Warning 1 warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss

求高手改错,不胜感激!

  • 写回答

5条回答

  • 鹿可语 2015-06-22 01:34
    关注

    没问题可以运行,你的头文件不是故意漏掉的吧

    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘