| 5 | 1/1 | 返回列表 |
| 查看: 1903 | 回復(fù): 13 | |||
| 當(dāng)前只顯示滿足指定條件的回帖,點(diǎn)擊這里查看本話題的所有回帖 | |||
[交流]
【討論】VC++與C語言
|
|||
| 感覺有時(shí)候用VC++來編譯C語言,總是有些莫名其妙的錯(cuò)誤,各位也遇到過嗎? |
» 搶金幣啦!回帖就可以得到:
+1/287
+1/187
+1/91
+1/88
+1/40
+1/32
+1/28
+1/19
+1/16
+1/10
+1/9
+1/9
+1/9
+1/8
+1/6
+1/6
+1/4
+1/3
+1/3
+1/2
|
比如說下面這個(gè)C語言,明明沒有錯(cuò)誤,但是用VC編譯總是會出現(xiàn)錯(cuò)誤: Compiling... lllk.c c:\documents and settings\administrator\桌面\cc\lllk.c(25) : error C2015: too many characters in constant c:\documents and settings\administrator\桌面\cc\lllk.c(25) : error C2061: syntax error : identifier 'bachelor' c:\documents and settings\administrator\桌面\cc\lllk.c(25) : error C2001: newline in constant c:\documents and settings\administrator\桌面\cc\lllk.c(27) : error C2065: 'sortkey' : undeclared identifier c:\documents and settings\administrator\桌面\cc\lllk.c(27) : warning C4047: 'function' : 'char ** ' differs in levels of indirection from 'int ' c:\documents and settings\administrator\桌面\cc\lllk.c(27) : warning C4024: 'sort' : different types for formal and actual parameter 3 Error executing cl.exe. lllk.obj - 4 error(s), 2 warning(s) 程序?yàn)椋?fieldset> #include #include #include typedef struct { char name[10];char degree[10];}ST; void sort(ST x[],int n,char *key[],int m) { int i,j,k,con1,con2; ST v; for(i=0;i { con1=k;break;} for(k=0;k if(con1>con2||con1==con2&&strcmp(x[j].name,x[j+1].name)>0) {v=x[j];x[j]=x[j+1];x[j+1]=v;} } } void main() { ST s[5]={{"A","master"},{"B","bachelor"},{"C",'doctor"},{"D",'bachelor"},{"E","master"}}; char *sortkey[]={"bachelor","master","doctor"};int i; sort(s,5,sortkey,3); for(i=0;i<5;i++) printf("\n%s %s",s[i].name,s[i].degree); getch(); } |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 271求調(diào)劑 +8 | 勒布朗@ 2026-03-31 | 10/500 |
|
|---|---|---|---|---|
|
[考研] 070300化學(xué)279求調(diào)劑 +9 | 哈哈哈^_^ 2026-03-31 | 11/550 |
|
|
[考研] 求調(diào)劑 生物學(xué) 377分 +6 | zzll03 2026-03-31 | 6/300 |
|
|
[考研] 353求調(diào)劑 +3 | 江上楓_26 2026-03-28 | 3/150 |
|
|
[考研] 282求調(diào)劑 不挑專業(yè) 求收留 +4 | Yam. 2026-03-30 | 5/250 |
|
|
[考研] 085601一志愿中山大學(xué)深圳材料工程330求調(diào)劑 +5 | pipiver 2026-03-30 | 5/250 |
|
|
[考研] 083000環(huán)境科學(xué)與工程調(diào)劑,總分281 +4 | 橙子(勝意) 2026-03-30 | 4/200 |
|
|
[考研] 11408總分309,一志愿東南大學(xué)求調(diào)劑,不挑專業(yè) +5 | 天賦帶到THU 2026-03-29 | 6/300 |
|
|
[考研] 一志愿北京化工大學(xué)材料與化工(085600)296求調(diào)劑 +25 | 稻妻小編 2026-03-26 | 25/1250 |
|
|
[考研] 抱歉 +3 | 田洪有 2026-03-30 | 3/150 |
|
|
[有機(jī)交流] 考研調(diào)劑 +8 | watb 2026-03-26 | 8/400 |
|
|
[考研] 材料化工340求調(diào)劑 +3 | jhx777 2026-03-30 | 3/150 |
|
|
[考研] 0703 化學(xué) 求調(diào)劑,一志愿山東大學(xué) 342 分 +7 | Shern—- 2026-03-28 | 7/350 |
|
|
[考研] 總分293求調(diào)劑 +8 | 加一一九 2026-03-25 | 11/550 |
|
|
[考研] 298求調(diào)劑 +3 | 種圣賜 2026-03-29 | 3/150 |
|
|
[考研] 305求調(diào)劑 +8 | RuiFairyrui 2026-03-28 | 8/400 |
|
|
[考研] 071000生物學(xué)求調(diào)劑,初試成績343 +7 | 小小甜面團(tuán) 2026-03-25 | 7/350 |
|
|
[考研] 一志愿南京航空航天大學(xué)材料學(xué)碩求調(diào)劑 +3 | @taotao 2026-03-28 | 3/150 |
|
|
[考研] 一志愿上海理工能源動(dòng)力(085800)310分求調(diào)劑 +3 | zhangmingc 2026-03-27 | 4/200 |
|
|
[考研] 求調(diào)劑 +3 | 李李不服輸 2026-03-25 | 3/150 |
|