注册 登录
编程论坛 C++教室

有个问题想求教一下是关于转义字符的

ww853211 发布于 2011-02-06 13:41, 394 次点击
#include "stdafx.h"
#include <iostream>
using namespace std;
int count=5;
int total;
int main()
{
    cout"<<total<<++count+6\n";
    return 0;
}


1>f:\win32\exce_01\exce_01\exce_01.cpp(8) : error C2143: 语法错误 : 缺少“;”(在“字符串”的前面)
我用的是vs2008
我知道如果用endl也可以但是我就是要用\n,不知哪位高手能帮忙解答一下,不胜感激!!!!!
3 回复
#2
迷失的木桶2011-02-06 13:54
cout"<<total<<++count+6\n";这句错了,仔细看看
#3
lucky5635912011-02-07 17:58
要用<<
#4
pangding2011-02-08 09:29
楼主是不是还不太会用 cout 呀。仔细看看自己写的和书上有什么不同~
1