導航:首頁 > 源碼編譯 > 代碼編譯不通過

代碼編譯不通過

發布時間:2022-06-18 08:23:49

❶ 我自己寫了一個代碼!可是老是編譯不通過! 代碼如下

程序寫的沒錯,是你編譯器的問題,你是用什麼編譯器?

❷ 為何這代碼編譯不通過

因為你使用的FindWindow是MFC類中的成員,只要使用沒封裝的API就可以了
如:
gamehwnd=::FindWindow(NULL,"Element Client");

❸ 為什麼這樣的代碼編譯不通過,錯在哪裡

修改如下 問題比較多 沒一一注釋 你自己對一下吧

#include<iostream>
#include<cstring>
using namespace std;
class mystring
{
public:
mystring();
mystring(const char*ch);
mystring(const mystring&str);
~mystring();
int size();
char* c_str();
int count(char ch)const;
void assign(const char*ch);
private:
int _size;
char* _string;
};
mystring::mystring()
{
_size=0;
_string=NULL;
}
mystring::mystring(const char*ch)
{
if(!ch)
{
_size=0;
_string=0;
}
else
{
_size=strlen(ch);
_string=new char[_size+1];
strcpy(_string,ch);
}
}
mystring ::mystring(const mystring&str)
{
if(!str._string)
{
_size=0;
_string=0;
}
else
{
_size=str._size;
_string=new char[_size+1];
strcpy(_string,str._string);
}
}
mystring::~mystring()
{
delete []_string;
}
int mystring::size()
{
if(_string == NULL) return 0;
return strlen(_string);
}
char*mystring::c_str()
{
if(_string == NULL) return "NULL";
return _string;
}
int mystring::count(char ch)const
{
int cnt=0;
for(int i=0;i<_size;i++)
{
if(_string[i]==ch)
{
++cnt;
}
}
return cnt;
}
void mystring::assign(const char*ch)
{
if(_string)
{
delete []_string;
}
if(ch)
{
_string=0;
_size=0;
}
else
{
_size=strlen(ch);
_string=new char[_size+1];
strcpy(_string,ch);
}
}
int main()
{
mystring a;
mystring b("you are a good student");
mystring c=b;
a.assign("Good boy");
cout<<"a="<<a.c_str()<<" The length is:"<<a.size()<<endl;
cout<<"b="<<b.c_str()<<" The length is:"<<b.size()<<endl;
cout<<"c="<<c.c_str()<<" The length is:"<<c.size()<<endl;
cout<<b.count('o')<<endl;
return 0;
}

❹ c++代碼編譯不通過,求幫忙看看有啥問題嗎

能給出全部源碼么?總不至於讓大家對這你圖片寫代碼吧?

//你看看這個能不能滿足要求。
#include<iostream>
#include<vector>
usingnamespacestd;
structListNode{
intval;
structListNode*next=nullptr;
ListNode(intx):val(x){}
};
voidfind(ListNode*head,vector<int>&a){
if(head==nullptr)return;
find(head->next,a);
a.push_back(head->val);
}
vector<int>printListFromTailToHead(structListNode*head){
vector<int>a;
find(head,a);
returna;
}
intmain(){
vector<int>c;
ListNode*a=newListNode(1);
ListNode*b=newListNode(2);
a->next=b;
vector<int>v=printListFromTailToHead(a);
for(autoit=v.begin();it!=v.end();++it){
cout<<*it<<"";
}
}

❺ 請問下面的代碼編譯為什麼不能通過

(unsigned int)((unsigned long)fTemp這句你是不是多了一個括弧。。。

❻ C++問題求教,下面這些代碼編譯不能通過到底是錯在哪裡了

試試
#include <iostream>
using namespace std;
template<class T,int n>
class people
{
public:
people();
people(const T&t);
T&operator[](int i);
void wen();
private:
T a[n];
};
template<class T,int n>
people<T,n>::people()
{
cout<<"執行構造函數\n";
for (int i=0;i<n;i++)
{
a[i]=(i+1);
}
}
template<class T,int n>
people<T,n>::people(const T&t)
{
cout<<"執行帶一個參數的構造函數\n";
for (int i=0;i<n;i++)
{
a[i]=t;
}
}
template<class T,int n>
T& people<T,n>::operator[](int i)
{
cout<<"執行下標運算符函數operator[]\n";
if (i<0||i>=n)
{
cerr<<"超出數組限制,第:"<<i<<"個元素溢出\n";
exit(EXIT_FAILURE);
}
return a[i];
}
template<class T,int n>
void people<T,n>::wen()
{
for (int i=0;i<n;i++)
{
cout<<"a["<<i<<"]:"<<a[i]<<"\t";
}
cout<<endl;
}
int main()
{
people<double,4>one;
one.wen();
people<double,4>*p=new people<double,4>[4];
for (int i=0;i<9;i++)
{
p[i]=one[i];
p[i].wen();
}
int j;
getchar();
return 0;
}

❼ 這個JAVA源代碼怎麼編譯不通過啊

看你需要
1,列印出來**.**格式的數據,那麼就要把你的Int f(Int t)的方法改為 long f(Int t)
2,只是列印int類型的數據,那麼就要將返回的值強制轉換為int類型,即return (int) f;

❽ bochs源代碼編譯不通過怎麼辦

下載最新的代碼
svn checkout https://svn.code.sf.net/p/bochs/code/trunk bochs-code

❾ 源代碼未編譯什麼情況

這些語言在寫完後綴名是.c,這個時候要先編譯成.h,才能運行。
所以你保存後要先點編譯,然後才能點運行。
編譯鍵一般在運行鍵旁邊啦,你點擊了再看行不行,有時如果你的文件有錯誤,編譯的時候會報錯出現error和警告,只有程序是正確的,你才能編譯通過,再運行
七爪

閱讀全文

與代碼編譯不通過相關的資料

熱點內容
程序員基本學歷 瀏覽:384
nginxjs壓縮 瀏覽:125
鵝剪app去哪裡下載 瀏覽:817
qt源碼調試失敗 瀏覽:694
伺服器抖動一下就好怎麼排查 瀏覽:150
天翼校園linux 瀏覽:144
c編譯器手機版無法打開文件 瀏覽:588
我的世界rpc伺服器地址 瀏覽:269
下c編程培訓 瀏覽:626
蘋果為什麼更新不了app 瀏覽:543
java字元替換函數 瀏覽:256
列印機列印不了pdf文件 瀏覽:121
ip地址伺服器地址是什麼 瀏覽:811
如何更換視頻伺服器 瀏覽:310
清朝pdf 瀏覽:692
dos刷新命令 瀏覽:39
程序員人數最多的公司 瀏覽:972
單片機怎麼連接裁剪機 瀏覽:486
防抖拍照app哪個好 瀏覽:905
富士f系列plc編程軟體 瀏覽:405