本文目錄一覽:
- 1、編程c語言總是有一個錯誤
- 2、c++ builder中字符型轉為十六進制數顯示時出現說「是個無效的整型值」,求各位幫小弟解答。
- 3、C語言 以下敘述中錯誤的是?
- 4、c++錯誤有哪幾種
- 5、C#從數據庫中提取數據生成XML文件,系統報錯,提示”♀(十六進制值0x0c)是無效的字符”
- 6、C語言錯誤
編程c語言總是有一個錯誤
執行 cl.exe 時出錯
這種錯誤一般是由於環境變量設置出錯導致的,參見網上的各種教程
實在不會就重裝一遍,安裝在默認路徑里一般就不會有這個問題了
c++ builder中字符型轉為十六進制數顯示時出現說「是個無效的整型值」,求各位幫小弟解答。
str1=”0x”+str1; 不要。
temp1=StrToInt(str1); 改為
=
{long n; sscanf(str1.c_str(), “%X”, n); temp1=n;}
為何不用數組和循環?不累嗎。
C語言 以下敘述中錯誤的是?
D錯了,靜態變量不是為了限制其他編譯單位的引用,靜態局部變量在函數內定義,但不像自動變量那樣,當調用時就存在,退出函數時就消失。靜態局部變量始終存在着,也就是說它的生存期為整個源程序。(2)靜態局部變量的生存期雖然為整個源程序,但是其作用域仍與自動變量相同,即只能在定義該變量的函數內使用該變量。退出該函數後, 儘管該變量還繼續存在,但不能使用它。(3)允許對構造類靜態局部量賦初值。若未賦以初值,則由系統自動賦值。數值型變量自動賦初值0,字符型變量賦空字符。
c++錯誤有哪幾種
Ambiguous operators need parentheses ———–不明確的運算需要用括號括起
Ambiguous symbol ”xxx” —————-不明確的符號
Argument list syntax error —————-參數表語法錯誤
Array bounds missing ——————丟失數組界限符
Array size toolarge —————–數組尺寸太大
Bad character in paramenters ——————參數中有不適當的字符
Bad file name format in include directive ——————–包含命令中文件名格式不正確
Bad ifdef directive synatax ——————————編譯預處理ifdef有語法錯
Bad undef directive syntax —————————編譯預處理undef有語法錯
Bit field too large —————-位字段太長
Call of non-function —————–調用未定義的函數
Call to function with no prototype —————調用函數時沒有函數的說明
Cannot modify a const object —————不允許修改常量對象
Case outside of switch —————-漏掉了case 語句
Case syntax error —————— Case 語法錯誤
Code has no effect —————–代碼不可述不可能執行到
Compound statement missing{ ——————–分程序漏掉”{”
Conflicting type modifiers ——————不明確的類型說明符
Constant expression required —————-要求常量表達式
Constant out of range in comparison —————–在比較中常量超出範圍
Conversion may lose significant digits —————–轉換時會丟失意義的數字
Conversion of near pointer not allowed —————–不允許轉換近指針
Could not find file ”xxx” ———————–找不到XXX文件
Declaration missing ; —————-說明缺少”;” houjiuming
Declaration syntax error —————–說明中出現語法錯誤
Default outside of switch —————— Default 出現在switch語句之外
Define directive needs an identifier ——————定義編譯預處理需要標識符
Division by zero ——————用零作除數
Do statement must have while —————— Do-while語句中缺少while部分
Enum syntax error ———————枚舉類型語法錯誤
Enumeration constant syntax error —————–枚舉常數語法錯誤
Error directive :xxx ————————錯誤的編譯預處理命令
Error writing output file ———————寫輸出文件錯誤
Expression syntax error ———————–表達式語法錯誤
Extra parameter in call ————————調用時出現多餘錯誤
File name too long —————-文件名太長
Function call missing —————–函數調用缺少右括號
Fuction definition out of place ——————函數定義位置錯誤
Fuction should return a value ——————函數必需返回一個值
Goto statement missing label —————— Goto語句沒有標號
Hexadecimal or octal constant too large ——————16進制或8進制常數太大
Illegal character ”x” ——————非法字符x
Illegal initialization ——————非法的初始化
Illegal octal digit ——————非法的8進制數字 houjiuming
Illegal pointer subtraction ——————非法的指針相減
Illegal structure operation ——————非法的結構體操作
Illegal use of floating point —————–非法的浮點運算
Illegal use of pointer ——————–指針使用非法
Improper use of a typedefsymbol —————-類型定義符號使用不恰當
In-line assembly not allowed —————–不允許使用行間彙編
Incompatible storage class —————–存儲類別不相容
Incompatible type conversion ——————–不相容的類型轉換
Incorrect number format ———————–錯誤的數據格式
Incorrect use of default ——————— Default使用不當
Invalid indirection ———————無效的間接運算
Invalid pointer addition ——————指針相加無效
Irreducible expression tree ———————–無法執行的表達式運算
Lvalue required —————————需要邏輯值0或非0值
Macro argument syntax error ——————-宏參數語法錯誤
Macro expansion too long ———————-宏的擴展以後太長
Mismatched number of parameters in definition ———————定義中參數個數不匹配
Misplaced break ———————此處不應出現break語句
Misplaced continue ————————此處不應出現continue語句
Misplaced decimal point ——————–此處不應出現小數點
Misplaced elif directive ——————–不應編譯預處理elif
Misplaced else ———————-此處不應出現else houjiuming
Misplaced else directive ——————此處不應出現編譯預處理else
Misplaced endif directive ——————-此處不應出現編譯預處理endif
Must be addressable ———————-必須是可以編址的
Must take address of memory location ——————必須存儲定位的地址
No declaration for function ”xxx” ——————-沒有函數xxx的說明
No stack —————缺少堆棧
No type information ——————沒有類型信息
Non-portable pointer assignment ——————–不可移動的指針(地址常數)賦值
Non-portable pointer comparison ——————–不可移動的指針(地址常數)比較
Non-portable pointer conversion ———————-不可移動的指針(地址常數)轉換
Not a valid expression format type ———————不合法的表達式格式
Not an allowed type ———————不允許使用的類型
Numeric constant too large ——————-數值常太大
Out of memory ——————-內存不夠用 houjiuming
Parameter ”xxx” is never used ——————能數xxx沒有用到
Pointer required on left side of – ———————–符號-的左邊必須是指針
Possible use of ”xxx” before definition ——————-在定義之前就使用了xxx(警告)
Possibly incorrect assignment —————-賦值可能不正確
Redeclaration of ”xxx” ——————-重複定義了xxx
Redefinition of ”xxx” is not identical ——————- xxx的兩次定義不一致
Register allocation failure ——————寄存器定址失敗
Repeat count needs an lvalue ——————重複計數需要邏輯值
Size of structure or array not known ——————結構體或數給大小不確定
Statement missing ; ——————語句後缺少”;”
Structure or union syntax error ————–結構體或聯合體語法錯誤
Structure size too large —————-結構體尺寸太大
Sub scripting missing ] —————-下標缺少右方括號
Superfluous with function or array ——————函數或數組中有多餘的””
Suspicious pointer conversion ———————可疑的指針轉換
Symbol limit exceeded —————符號超限
Too few parameters in call —————–函數調用時的實參少於函數的參數不
Too many default cases ——————- Default太多(switch語句中一個)
Too many error or warning messages ——————–錯誤或警告信息太多
Too many type in declaration —————–說明中類型太多 houjiuming
Too much auto memory in function —————–函數用到的局部存儲太多
Too much global data defined in file ——————文件中全局數據太多
Two consecutive dots —————–兩個連續的句點
Type mismatch in parameter xxx —————-參數xxx類型不匹配
Type mismatch in redeclaration of ”xxx” —————- xxx重定義的類型不匹配
Unable to create output file ”xxx” —————-無法建立輸出文件xxx
Unable to open include file ”xxx” —————無法打開被包含的文件xxx
Unable to open input file ”xxx” —————-無法打開輸入文件xxx
Undefined label ”xxx” ——————-沒有定義的標號xxx
Undefined structure ”xxx” —————–沒有定義的結構xxx
Undefined symbol ”xxx” —————–沒有定義的符號xxx
Unexpected end of file in comment started on line xxx ———-從xxx行開始的註解尚未結束文件不能結束
Unexpected end of file in conditional started on line xxx —-從xxx 開始的條件語句尚未結束文件不能結束
Unknown assemble instruction —————-未知的彙編結構 houjiuming
Unknown option —————未知的操作
Unknown preprocessor directive: ”xxx” —————–不認識的預處理命令xxx
Unreachable code ——————無路可達的代碼
Unterminated string or character constant —————–字符串缺少引號
User break —————-用戶強行中斷了程序
Void functions may not return a value —————– Void類型的函數不應有返回值
Wrong number of arguments —————–調用函數的參數數目錯
”xxx” not an argument —————– xxx不是參數
”xxx” not part of structure ——————– xxx不是結構體的一部分
xxx statement missing ( ——————– xxx語句缺少左括號
xxx statement missing ) —————— xxx語句缺少右括號
xxx statement missing ; ——————– xxx缺少分號 houjiuming
xxx” declared but never used ——————-說明了xxx但沒有使用
xxx” is assigned a value which is never used ———————-給xxx賦了值但未用過
Zero length structure ——————結構體的長度為零
C#從數據庫中提取數據生成XML文件,系統報錯,提示”♀(十六進制值0x0c)是無效的字符”
產生原因是xml文件中包含低位非打印字符造成的
處理方法:在產生xml文件的時候,過濾低位非打印字符
public static string ReplaceLowOrderASCIICharacters(string tmp)
{
StringBuilder info = new StringBuilder();
foreach (char cc in tmp)
{
int ss = (int)cc;
if (((ss = 0) (ss = 8)) || ((ss = 11) (ss = 12)) || ((ss = 14) (ss = 32)))
info.AppendFormat(” “, ss);//{0:X};
else info.Append(cc);
}
return info.ToString();
}
C語言錯誤
1. Ambiguous operators need parentheses — 不明確的運算需要用括號括起
2. Ambiguous symbol ‘xxx’ — 不明確的符號
3. Argument list syntax error — 參數表語法錯誤
4. Array bounds missing — 丟失數組界限符
5. Array size toolarge — 數組尺寸太大
6. Bad character in paramenters — 參數中有不適當的字符
7. Bad file name format in include directive — 包含命令中文件名格式不正確
8. Bad ifdef directive synatax — 編譯預處理ifdef有語法錯
9. Bad undef directive syntax — 編譯預處理undef有語法錯
10. Bit field too large — 位字段太長
11. Call of non-function — 調用未定義的函數
12. Call to function with no prototype — 調用函數時沒有函數的說明
13. Cannot modify a const object — 不允許修改常量對象
14. Case outside of switch — 漏掉了case 語句
15. Case syntax error — Case 語法錯誤
16. Code has no effect — 代碼不可能執行到
17. Compound statement missing{ — 分程序漏掉”{”
18. Conflicting type modifiers — 不明確的類型說明符
19. Constant expression required — 要求常量表達式
20. Constant out of range in comparison — 在比較中常量超出範圍
21. Conversion may lose significant digits — 轉換時會丟失意義的數字
22. Conversion of near pointer not allowed — 不允許轉換近指針
23. Could not find file ‘xxx’ — 找不到XXX文件
24. Declaration missing ; — 說明缺少”;”
25. Declaration syntax error — 說明中出現語法錯誤
26. Default outside of switch — Default 出現在switch語句之外
27. Define directive needs an identifier — 定義編譯預處理需要標識符
28. Division by zero — 用零作除數
29. Do statement must have while — Do-while語句中缺少while部分
30. Enum syntax error — 枚舉類型語法錯誤
31. Enumeration constant syntax error — 枚舉常數語法錯誤
32. Error directive :xxx — 錯誤的編譯預處理命令
33. Error writing output file — 寫輸出文件錯誤
34. Expression syntax error — 表達式語法錯誤
35. Extra parameter in call — 調用時出現多餘錯誤
36. File name too long — 文件名太長
37. Function call missing ) — 函數調用缺少右括號
38. Fuction definition out of place — 函數定義位置錯誤
39. Fuction should return a value — 函數必需返回一個值
40. Goto statement missing label — Goto語句沒有標號
41. Hexadecimal or octal constant too large — 16進制或8進制常數太大
42. Illegal character ‘x’ — 非法字符x
43. Illegal initialization — 非法的初始化
44. Illegal octal digit — 非法的8進制數字
45. Illegal pointer subtraction — 非法的指針相減
46. Illegal structure operation — 非法的結構體操作
47. Illegal use of floating point — 非法的浮點運算
48. Illegal use of pointer — 指針使用非法
49. Improper use of a typedefsymbol — 類型定義符號使用不恰當
50. In-line assembly not allowed — 不允許使用行間彙編
51. Incompatible storage class — 存儲類別不相容
52. Incompatible type conversion — 不相容的類型轉換
53. Incorrect number format — 錯誤的數據格式
54. Incorrect use of default — Default使用不當
55. Invalid indirection — 無效的間接運算
56. Invalid pointer addition — 指針相加無效
57. Irreducible expression tree — 無法執行的表達式運算
58. Lvalue required — 需要邏輯值0或非0值
59. Macro argument syntax error — 宏參數語法錯誤
60. Macro expansion too long — 宏的擴展以後太長
61. Mismatched number of parameters in definition — 定義中參數個數不匹配
62. Misplaced break — 此處不應出現break語句
63. Misplaced continue — 此處不應出現continue語句
64. Misplaced decimal point — 此處不應出現小數點
65. Misplaced elif directive — 不應編譯預處理elif
66. Misplaced else — 此處不應出現else
67. Misplaced else directive — 此處不應出現編譯預處理else
68. Misplaced endif directive — 此處不應出現編譯預處理endif
69. Must be addressable — 必須是可以編址的
70. Must take address of memory location — 必須存儲定位的地址
71. No declaration for function ‘xxx’ — 沒有函數xxx的說明
72. No stack — 缺少堆棧
73. No type information — 沒有類型信息
74. Non-portable pointer assignment — 不可移動的指針(地址常數)賦值
75. Non-portable pointer comparison — 不可移動的指針(地址常數)比較
76. Non-portable pointer conversion — 不可移動的指針(地址常數)轉換
77. Not a valid expression format type — 不合法的表達式格式
78. Not an allowed type — 不允許使用的類型
79. Numeric constant too large — 數值常太大
80. Out of memory — 內存不夠用
81. Parameter ‘xxx’ is never used — 能數xxx沒有用到
82. Pointer required on left side of – — 符號-的左邊必須是指針
83. Possible use of ‘xxx’ before definition — 在定義之前就使用了xxx(警告)
84. Possibly incorrect assignment — 賦值可能不正確
85. Redeclaration of ‘xxx’ — 重複定義了xxx
86. Redefinition of ‘xxx’ is not identical — xxx的兩次定義不一致
87. Register allocation failure — 寄存器定址失敗
88. Repeat count needs an lvalue — 重複計數需要邏輯值
89. Size of structure or array not known — 結構體或數給大小不確定
90. Statement missing ; — 語句後缺少”;”
91. Structure or union syntax error — 結構體或聯合體語法錯誤
92. Structure size too large — 結構體尺寸太大
93. Sub scripting missing ] — 下標缺少右方括號
94. Superfluous with function or array — 函數或數組中有多餘的””
95. Suspicious pointer conversion — 可疑的指針轉換
96. Symbol limit exceeded — 符號超限
97. Too few parameters in call — 函數調用時的實參少於函數的參數不
98. Too many default cases — Default太多(switch語句中一個)
99. Too many error or warning messages — 錯誤或警告信息太多
100. Too many type in declaration — 說明中類型太多
101. Too much auto memory in function — 函數用到的局部存儲太多
102. Too much global data defined in file — 文件中全局數據太多
103. Two consecutive dots — 兩個連續的句點
104. Type mismatch in parameter xxx — 參數xxx類型不匹配
105. Type mismatch in redeclaration of ‘xxx’ — xxx重定義的類型不匹配
106. Unable to create output file ‘xxx’ — 無法建立輸出文件xxx
107. Unable to open include file ‘xxx’ — 無法打開被包含的文件xxx
108. Unable to open input file ‘xxx’ — 無法打開輸入文件xxx
109. Undefined label ‘xxx’ — 沒有定義的標號xxx
110. Undefined structure ‘xxx’ — 沒有定義的結構xxx
111. Undefined symbol ‘xxx’ — 沒有定義的符號xxx
112. Unexpected end of file in comment started on line xxx — 從xxx行開始的註解尚未結束文件不能結束
113. Unexpected end of file in conditional started on line xxx — 從xxx 開始的條件語句尚未結束文件不能結束
114. Unknown assemble instruction — 未知的彙編結構
115. Unknown option — 未知的操作
116. Unknown preprocessor directive: ‘xxx’ — 不認識的預處理命令xxx
117. Unreachable code — 無路可達的代碼
118. Unterminated string or character constant — 字符串缺少引號
119. User break — 用戶強行中斷了程序
120. Void functions may not return a value — Void類型的函數不應有返回值
121. Wrong number of arguments — 調用函數的參數數目錯
122. ‘xxx’ not an argument — xxx不是參數
123. ‘xxx’ not part of structure — xxx不是結構體的一部分
124. xxx statement missing ( — xxx語句缺少左括號
125. xxx statement missing ) — xxx語句缺少右括號
126. xxx statement missing ; — xxx缺少分號
127. xxx’ declared but never used — 說明了xxx但沒有使用
128. xxx’ is assigned a value which is never used — 給xxx賦了值但未用過
原創文章,作者:小藍,如若轉載,請註明出處:https://www.506064.com/zh-hk/n/237000.html