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 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器