为什么我的代码在终端中没有输出任何内容.开始新行没有错误
Why does my code not output anything in the terminal. Starts a new line no errors
这是我在C++文件中的代码:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World" << endl;
return 0;
}
我的编译器是Clang。是的,我确实在终端中输入了"clang++"。问题是,它运行它并且不输出任何内容。它只是开始一条新行。 我正在运行 Clang 版本 3.8.0。
正如你所说,clang++ 是编译器,也就是说,它将你的代码转换为可以执行的二进制文件。它不执行程序本身。
默认情况下,编译后的文件名是a.out
,因此编译后,要执行程序,您应该运行:
./a.out
您可以像这样指定输出文件名:
clang++ infile.cpp -o outfile
然后运行二进制文件:
./outfile
相关文章:
- 这是使用回溯的 nqueen 问题,但我使用了动态 2d 数组,我的程序编译良好,但不返回任何输出
- COUT 无法提供输出可能是由于内联组装
- 是否有任何内置的哈希图函数来处理 c++ 中的值输入?
- 将文本文件读取到2D数组中,但数组开始为超过数组[39][]的任何内容输出胡言乱语
- 是否有任何内置函数可以检查给定的两个数字在给定整数数组中的顺序是否相同?
- C++ 中是否有任何内置阶乘函数?
- Linux Ubuntu 中的文件内输出 unicode 符号
- 是否有任何内置函数可以告诉编译器分支是否可预测
- 从用户输入范围内输出质量数量
- 我需要在C /C#中使用图形.我可以使用任何内置的C /C#库
- 是否有任何内置类可以处理C 中的大整数值
- 为什么我的OpenGL引擎中没有从MyGUI获得任何屏幕输出
- c ++中是否有任何内置功能可以在计划的时间运行任务
- 是否有任何内置的 UTF 在 c++ 在窗口中
- 在VC++2010中执行任何内置的ARRAY函数
- C++:如何在不使用任何内置函数的情况下将字符串转换为整数
- 是否有任何内置的CUDA函数允许CUDA内核向主机代码报告错误?
- 我如何在常数时间(O(1))内获得字母表(1-26)中字符的数值/位置,而不使用任何内置方法或函数
- C++中的任何内置哈希方法
- c++库中的任何内置夹子方法