常見錯誤點總結

2021-08-18 01:21:23 字數 512 閱讀 9573

1、

//    int _h,int _m,int _s;//錯誤,因為之間應該用分號;

int _h,_m,_s;

2、

time(const time& p):_h(p._h)賦值的時候是p.,千萬別忘記這個點。

3、

int swap(int &a,int &b)//a和b前面的int前往別忘;
4、在使用容器的時候,千萬別忘記清除;

5、函式名稱和返回的變數名不要為同乙個名字

6、在下面的**中,有了無參的建構函式後,就不要在double x(double i)中寫i=0了,這樣會造成二義性;

double x()

double y()

double x(double i)

double y(double j)

有了無參建構函式就不要再寫帶有預設值的建構函式了;

錯誤點總結

gate 總結 一般來說使用kmp能保證不出錯 inline int read while ch 0 ch 9 s s 10 ch 0 ch getchar return s w 各型別 快讀 template void read t x int x read x pragma warning di...

hibernate錯誤點記錄

1.如果繼承了hibernatedaosupport,你必須得用xml方式進行注入sessionfactory,不能用註解的方式注入,因為sessionfactory在hibernatedaosupport裡面,你看不到,所以沒法用 resource注入。否則會報異常。2.如果使用的是hiberna...

誤點總結(一)

severlet頁面中的請求 request.getrequestdispatcher jsp forward req,resp string sql update student set student name student age student student address studen...