Codelite C ++程序无法编译和运行

时间:2015-04-07 16:57:27

标签: c++ codelite

我昨天安装了codellite 7.0并且一直在尝试使用它。但似乎有一些问题。我无法运行任何代码。 现在代码非常简单。

#include <stdio.h>

int main(int argc, char **argv)
{
   printf("hello world\n");
return 0;
}

但是,它返回以下内容,并且Press any key to continue

输出为空白
  

当前工作目录:D:\ .....

     

运行程序:le_exec.exe ./1

     

程序退出并返回代码:0

1 个答案:

答案 0 :(得分:2)

你的程序运行正常,唯一的问题是在printf程序返回0并立即关闭后,它会运行并打印出来&#34; hello world&#34 ;,你只需要#&#34; 39;没时间看。

使程序等待用户输入,以便您可以看到输出使用cin.get()

#include <stdio.h>
#include <iostream>

int main(int argc, char **argv)
{
   printf("hello world\n");
   std::cin.get();
return 0;
}