關(guān)于編譯器的問題
我用codeblocks運行C++的這段代碼時有問題,這是什么問題,該怎么解決呢?
代碼:
#include<stdlib.h>
int main(void)
{
? ? system("pause");
? ? return 0;
}
結(jié)果顯示兩行:
系統(tǒng)找不到指定路徑。
請按任意鍵繼續(xù)...
我用codeblocks運行C++的這段代碼時有問題,這是什么問題,該怎么解決呢?
代碼:
#include<stdlib.h>
int main(void)
{
? ? system("pause");
? ? return 0;
}
結(jié)果顯示兩行:
系統(tǒng)找不到指定路徑。
請按任意鍵繼續(xù)...
2016-06-24
舉報
2016-08-11
#include <iostream>
#include <stdlib.h>
using namespace std;????//你缺少命名空間的引用
int main(void)
{
cout << "請輸入一個整數(shù):" << endl;
int x = 0;
cin >> x;
cout << oct << x << endl;
cout << dec << x << endl;
//cout << hex << x << ednl;????//這句話的最后一個命令寫錯了
cout << hex << x << endl;
cout << "請輸入一個布爾值(0、1):" << endl;
bool y = false;
cin >> y;
cout << boolalpha << y << endl;
system("pause");
return 0;
}
2016-06-28
謝謝你,我安裝了vs2010,之后運行視頻上的代碼,又出問題了。
代碼是:
#include <iostream>
#include <stdlib.h>
int main(void)
{
cout<<"請輸入一個整數(shù):"<<endl;
int x=0;
cin>>x;
cout<<oct<<x<<endl;
cout<<dec<<x<<endl;
cout<<hex<<x<<ednl;
cout<<"請輸入一個布爾值(0、1):"<<endl;
bool y=false;
cin>>y;
cout<<boolalpha<<y<<endl;
system("pause");
return 0;
}
問題是生成錯誤,具體是無法啟動程序,系統(tǒng)找不到指定的文件,也百度過了,還是解決不了這個問題。
2016-06-25
代碼是正確的 應(yīng)該是codeblocks中沒有<stdlib.h>吧 要么換個開發(fā)工具(vs2010就不錯)要么去找一找相關(guān)路徑。