hello.cpp 第一个C++程序(本博客没有特指都是以QT测试)
生活随笔
收集整理的這篇文章主要介紹了
hello.cpp 第一个C++程序(本博客没有特指都是以QT测试)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
操作步驟:
1.文件->新建文件或項目(N)->New File or Project->Qt Console Application->Choose->“名稱”中輸入工程名稱->“創建路徑”中輸入保存位置->下一步->選擇“工具包”->下一步->完成。
?
1.新標準
1 #include <iostream> 2 int main(int argc, char *argv[]) 3 { 4 std::cout << "hello world\n"; 5 return 0; 6 }2.舊的標準(發現QT不支持)
1 #include <iostream.h> // 必須使用.h 2 int main(int argc, char *argv[]) 3 { 4 cout << "hello world\n"; // 不再使用std:: 5 return 0; 6 }3.增加輸入
1 #include <iostream> 2 int main(int argc, char *argv[]) 3 { 4 char response; 5 std::cin >> response; 6 std::cout << "hello world\n"; 7 return 0; 8 }?
轉載于:https://www.cnblogs.com/FKdelphi/p/10273519.html
總結
以上是生活随笔為你收集整理的hello.cpp 第一个C++程序(本博客没有特指都是以QT测试)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: go语言之进阶篇主协程先退出导致子协程没
- 下一篇: s3c2440移植MQTT