簡體   English   中英

Codelite C ++程序無法編譯和運行

[英]Codelite C++ program not compiling and running

我昨天安裝了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

您的程序運行良好,唯一的問題是,在printf之后,該程序返回0並立即關閉,它確實運行並打印出“ hello world”,您只是沒有時間查看它。

要使程序等待用戶輸入,以便可以使用cin.get()查看輸出:

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

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM