C++ - 错误:在'<<'标记之前预期的primary-expression

Sim*_*ity 1 c++ pointers

当我添加此语句时(the_pointer的类型为int*)

<<"\nThe contents of the variable the_pointer is pointing at is : "<<*the_pointer;
Run Code Online (Sandbox Code Playgroud)

编译器返回以下错误:

error: expected primary-expression before '<<' token

这是为什么?

谢谢.

Ton*_*nyK 5

根据你对你的问题的评论判断,你有这样的事情:

std::cout << x
          << y
          << z ;
Run Code Online (Sandbox Code Playgroud)

这是一个语句,因为在x或y之后没有半冒号语句终止符.但由于z之后的分号,下一条这样的线将会失败.