【问题标题】:C++ cout in VS Code is not printing the value of variableVS Code 中的 C++ cout 未打印变量的值
【发布时间】:2021-10-28 09:47:48
【问题描述】:

当我点击运行时,在第一行之后,程序终止而不打印'age'的值。

# include<iostream>

using namespace std;

int main(){
    int age = 4;
    cout<<"dbcuhdihidh"<<age<<"ashsbcjsahcij"<<endl;
}

【问题讨论】:

  • 我不习惯你的设置,但看起来你运行的是旧版本的程序。重新编译。
  • # 和 iostream 之间有一个空格

标签: c++ cout


【解决方案1】:

重新编译你的程序,效果很好。

【讨论】:

  • 请添加更多详细信息以扩展您的答案,例如工作代码或文档引用。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多