{"id":4699,"date":"2024-03-01T12:01:01","date_gmt":"2024-03-01T04:01:01","guid":{"rendered":""},"modified":"2024-03-01T12:01:01","modified_gmt":"2024-03-01T04:01:01","slug":"\u534e\u4e3a\u8f6f\u4ef6\u7f16\u7a0b\u8f68\u8303\u548c\u5b9e\u4f8b","status":"publish","type":"post","link":"https:\/\/mushiming.com\/4699.html","title":{"rendered":"\u534e\u4e3a\u8f6f\u4ef6\u7f16\u7a0b\u8f68\u8303\u548c\u5b9e\u4f8b"},"content":{"rendered":"
\u534e\u4e3a\u8f6f\u4ef6\u7f16\u7a0b\u8f68\u8303\u548c\u5b9e\u4f8b \u76ee \u5f55 \u4e00 \u6392\u5b57
\u516d <\/p>\n
\u4e8c \u8be0\u91ca
11 <\/p>\n
\u4e09 \u6807\u8bc6\u7b26\u5b9a\u540d
18 <\/p>\n
\u56db \u53ef\u8bfb\u6027
20 <\/p>\n
\u4e94 \u53d8\u91cf\u3001\u6784\u9020
22 <\/p>\n
\u516d \u51fd\u6570\u3001\u8fdb\u7a0b
28 <\/p>\n
\u4e03 \u53ef\u6d4b\u6027
36 <\/p>\n
\u516b \u7a0b\u5e8f\u6548\u7387
40 <\/p>\n
\u4e5d \u8d28\u91cf\u4fdd\u8bc1
44 <\/p>\n
\u5341 \u4ee3\u7801\u7f16\u8005\u3001\u7f16\u8bd1\u3001\u8003\u5bdf
50 <\/p>\n
11 \u4ee3\u7801\u6d4b\u8bd5\u3001\u7ef4\u62a4
52 <\/p>\n
12 \u5b8f
53 <\/p>\n
\u4e00 \u6392\u5b57
\u00b9\u4e00-\u4e00\uff1a\u7a0b\u5e8f\u5757\u8981\u91c7\u53d6\u7f29\u8fdb\u4f5c\u98ce\u7f16\u64b0\uff0c\u7f29\u8fdb\u7684\u7a7a\u683c\u6570\u4e3a4\u4e2a\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u5173\u4e8e\u7531\u5f00\u53d1\u5de5\u5177\u81ea\u52a8\u751f\u6210\u7684\u4ee3\u7801\u53ef\u4ee5\u6709\u4e0d\u4e00\u81f4\u3002 <\/p>\n
\u00b9\u4e00-\u4e8c\uff1a\u76f8\u5bf9\u72ec\u529b\u7684\u7a0b\u5e8f\u5757\u5176\u95f4\u3001\u53d8\u91cf\u8bf4\u660e\u4ee5\u540e\u52a1\u987b\u52a0\u7a7a\u884c\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u4f8b\u8bc1\u4e0d\u7b26\u5408\u8f68\u8303\u3002 <\/p>\n
if (!valid_ni(ni)) <\/p>\n
{ <\/p>\n
... \/\/ program code <\/p>\n
} <\/p>\n
repssn_ind = ssn_data[index].repssn_index; <\/p>\n
repssn_ni = ssn_data[index].ni; <\/p>\n
\u5f53\u5982\u6b21\u4e66\u5199 <\/p>\n
if (!valid_ni(ni)) <\/p>\n
{ <\/p>\n
... \/\/ program code <\/p>\n
} <\/p>\n
repssn_ind = ssn_data[index].repssn_index; <\/p>\n
repssn_ni = ssn_data[index].ni; <\/p>\n
\u00b9\u4e00-\u4e09\uff1a\u8f83\u957f\u7684\u8bdd\u8bed\uff08>80\u5b57\u7b26\uff09\u8981\u5206\u4e3a\u591a\u884c\u4e66\u5199\uff0c\u957f\u8868\u8fbe\u5f0f\u8981\u5728\u4f4e\u4f18\u5148\u7ea7\u64cd\u4f5c\u7b26\u5904\u533a\u5212\u65b0\u884c\uff0c\u64cd\u4f5c\u7b26\u653e\u5728\u65b0\u884c\u4e4b\u9996\uff0c\u533a\u5212\u51fa\u7684\u65b0\u884c\u8981\u5f00\u5c55\u9002\u5f53\u7684\u7f29\u8fdb\uff0c\u4f7f\u6392\u5b57\u9f50\u6574\uff0c\u8bdd\u8bed\u53ef\u8bfb\u3002 <\/p>\n
\u793a\u8303\uff1a <\/p>\n
perm_count_msg.head.len = NO\u4e03_TO_STAT_PERM_COUNT_LEN <\/p>\n
+ STAT_SIZE_PER_FRAM * sizeof( _UL ); <\/p>\n
act_task_table[frame_id * STAT_TASK_CHECK_NUMBER + index].occupied <\/p>\n
= stat_poi[index].occupied; <\/p>\n
act_task_table[taskno].duration_true_or_false <\/p>\n
= SYS_get_sccp_statistic_state( stat_item ); <\/p>\n
report_or_not_flag = ((taskno < MAX_ACT_TASK_NUMBER) <\/p>\n
&& (n\u4e03stat_stat_item_valid (stat_item)) <\/p>\n
&& (act_task_table[taskno].result_data != \u96f6)); <\/p>\n
\u00b9\u4e00-\u56db\uff1a\u5faa\u73af\u3001\u5224\u65ad\u7b49\u8bdd\u8bed\u4e2d\u82e5\u6709\u8f83\u957f\u7684\u8868\u8fbe\u5f0f\u6216\u8bdd\u8bed\uff0c\u5219\u8981\u8fdb\u5c55\u987a\u5e94\u7684\u533a\u5212\uff0c\u957f\u8868\u8fbe\u5f0f\u8981\u5728\u4f4e\u4f18\u5148\u7ea7\u64cd\u4f5c\u7b26\u5904\u533a\u5212\u65b0\u884c\uff0c\u64cd\u4f5c\u7b26\u653e\u5728\u65b0\u884c\u4e4b\u9996\u3002 <\/p>\n
\u793a\u8303\uff1a <\/p>\n
if ((taskno < max_act_task_number) <\/p>\n
&& (n\u4e03stat_stat_item_valid (stat_item))) <\/p>\n
{ <\/p>\n
... \/\/ program code <\/p>\n
} <\/p>\n
for (i = \u96f6, j = \u96f6; (i < BufferKeyword[word_index].word_length) <\/p>\n
&& (j < NewKeyword.word_length); i++, j++) <\/p>\n
{ <\/p>\n
... \/\/ program code <\/p>\n
} <\/p>\n
for (i = \u96f6, j = \u96f6; <\/p>\n
(i < first_word_length) && (j < second_word_length); <\/p>\n
i++, j++) <\/p>\n
{ <\/p>\n
... \/\/ program code <\/p>\n
} <\/p>\n
\u00b9\u4e00-\u4e94\uff1a\u82e5\u51fd\u6570\u6216\u8fc7\u7a0b\u4e2d\u7684\u53c2\u6570\u8f83\u957f\uff0c\u5219\u8981\u5f00\u5c55\u9002\u5f53\u7684\u533a\u5212\u3002 <\/p>\n
\u793a\u8303\uff1a <\/p>\n
n\u4e03stat_str_compare((BYTE *) & stat_object, <\/p>\n
(BYTE *) & (act_task_table[taskno].stat_object), <\/p>\n
sizeof (_STAT_OBJECT)); <\/p>\n
n\u4e03stat_flash_act_duration( stat_item, frame_id *STAT_TASK_CHECK_NUMBER <\/p>\n
+ index, stat_object ); <\/p>\n
\u00b9\u4e00-\u516d\uff1a\u4e0d\u5141\u8bb8\u628a\u591a\u4e2a\u8bcd\u7ec4\u53e5\u5199\u5728\u4e00\u8d77\u4e2d\uff0c\u5373\u4e00\u8d77\u53ea\u5199\u4e00\u6761\u8bdd\u8bed\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u4e8b\u4f8b\u4e0d\u7b26\u5408\u8f68\u8303\u3002 <\/p>\n
rect.length = \u96f6; rect.width = \u96f6; <\/p>\n
\u5f53\u5982\u6b21\u4e66\u5199 <\/p>\n
rect.length = \u96f6; <\/p>\n
rect.width = \u96f6; <\/p>\n
\u00b9\u4e00-\u4e03\uff1aif\u3001for\u3001do\u3001while\u3001case\u3001switch\u3001default\u7b49\u8bdd\u8bed\u81ea\u5360\u4e00\u8d77\uff0c\u4e14if\u3001for\u3001do\u3001while\u7b49\u8bdd\u8bed\u7684\u65bd\u884c\u8bdd\u8bed\u4e00\u90e8\u5206\u65e0\u8bba\u662f\u51e0\u591a\u90fd\u8981\u52a0\u62ec\u53f7{}\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u4f8b\u8bc1\u4e0d\u7b26\u5408\u8f68\u8303\u3002 <\/p>\n
if (pUserCR == NULL) return; <\/p>\n
\u5f53\u5982\u6b21\u4e66\u5199\uff1a <\/p>\n
if (pUserCR == NULL) <\/p>\n
{ <\/p>\n
return; <\/p>\n
} <\/p>\n
\u00b9\u4e00-\u516b\uff1a\u5bf9\u9f50\u53ea\u8fd0\u7528\u7a7a\u683c\u952e\uff0c\u4e0d\u8fd0\u7528TAB\u952e\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u7701\u5f97\u7528\u4e0d\u540c\u7684\u7f16\u8f91\u5668\u9605\u8bfb\u7a0b\u5e8f\u65f6\uff0c\u56e0TAB\u952e\u6240\u8bbe\u7acb\u7684\u7a7a\u683c\u6570\u989d\u4e0d\u540c\u800c\u4fc3\u6210\u7a0b\u5e8f\u683c\u5c40\u4e0d\u6574\u9f50\uff0c\u4e0d\u7528\u5e94\u7528BC\u4f5c\u4e3a\u7f16\u8f91\u5668\u5408\u7248\u672c\uff0c\u7531\u4e8eBC\u80fd\u81ea\u52a8\u5c068\u4e2a\u7a7a\u683c\u6210\u4e3a\u4e00\u4e2aTAB\u952e\uff0c\u56e0\u800c\u8fd0\u7528BC\u5408\u8fdb\u7684\u7248\u672c\u5927\u591a\u4f1a\u5c06\u7f29\u8fdb\u9a9a\u4e71\u3002 <\/p>\n
\u00b9\u4e00-\u4e5d\uff1a\u51fd\u6570\u6216\u5386\u7a0b\u7684\u5f00\u59cb\u3001\u6784\u9020\u7684\u5b9a\u4e49\u53ca\u5faa\u73af\u3001\u5224\u65ad\u7b49\u8bdd\u8bed\u4e2d\u7684\u4ee3\u7801\u90fd\u8981\u91c7\u53d6\u7f29\u8fdb\u4f5c\u6d3e\uff0ccase\u8bdd\u8bed\u505c\u7684\u666f\u51b5\u5904\u7f6e\u8bdd\u8bed\u4e5f\u8981\u9075\u7167\u8bdd\u8bed\u7f29\u8fdb\u8981\u6c42\u3002 <\/p>\n
\u00b9\u4e00-\u5341\uff1a\u7a0b\u5e8f\u5757\u7684\u754c\u7ebf\u7b26\uff08\u5982C\/C++\u8bed\u8a00\u7684\u5927\u62ec\u53f7\u2018{\u2019\u548c\u2018}\u2019\uff09\u5f53\u5404\u72ec\u6709\u4e00\u8d77\u800c\u4e14\u5750\u843d\u540c\u4e00\u5217\uff0c\u4e0e\u6b64\u540c\u65f6\u4e0e\u6458\u5f15\u5b83\u4eec\u7684\u8bdd\u8bed\u5de6\u5bf9\u9f50\u3002\u5728\u51fd\u6570\u4f53\u7684\u5f00\u59cb\u3001\u79cd\u7684\u5b9a\u4e49\u3001\u6784\u9020\u7684\u5b9a\u4e49\u3001\u679a\u4e3e\u7684\u5b9a\u4e49\u4ee5\u53caif\u3001for\u3001do\u3001while\u3001switch\u3001case\u8bdd\u8bed\u4e2d\u7684\u7a0b\u5e8f\u90fd\u8981\u91c7\u53d6\u4e0a\u8ff0\u7684\u7f29\u8fdb\u6a21\u5f0f\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u4f8b\u8bc1\u4e0d\u7b26\u5408\u8f68\u8303\u3002 <\/p>\n
for (...) { <\/p>\n
... \/\/ program code <\/p>\n
} <\/p>\n
if (...) <\/p>\n
{ <\/p>\n
... \/\/ program code <\/p>\n
} <\/p>\n
void example_fun( void ) <\/p>\n
{ <\/p>\n
... \/\/ program code <\/p>\n
} <\/p>\n
\u5f53\u5982\u6b21\u4e66\u5199\u3002 <\/p>\n
for (...) <\/p>\n
{ <\/p>\n
... \/\/ program code <\/p>\n
} <\/p>\n
if (...) <\/p>\n
{ <\/p>\n
... \/\/ program code <\/p>\n
} <\/p>\n
void example_fun( void ) <\/p>\n
{ <\/p>\n
... \/\/ program code <\/p>\n
} <\/p>\n
\u00b9\u4e00-11\uff1a\u5728\u4e24\u4e2a\u4e4b\u4e0a\u7684\u5173\u952e\u5b57\u3001\u53d8\u91cf\u3001\u6052\u91cf\u5f00\u5c55\u76f8\u5f53\u64cd\u4f5c\u65f6\uff0c\u5b83\u4eec\u5176\u95f4\u7684\u64cd\u4f5c\u7b26\u5148\u5934\u3001\u4ee5\u540e\u53ef\u80fd\u524d\u524d\u540e\u540e\u8981\u6dfb\u7a7a\u683c\uff1b\u8fdb\u5c55\u975e\u76f8\u5f53\u64cd\u4f5c\u65f6\uff0c\u5982\u679c\u662f\u5173\u7cfb\u5bc6\u5207\u7684\u9a6c\u4e0a\u64cd\u4f5c\u7b26\uff08\u5982\uff0d>\uff09\uff0c\u540e\u4e0d\u5e94\u52a0\u7a7a\u683c\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u91c7\u53d6\u8fd9\u79cd\u7d27\u5bc6\u5f62\u5f0f\u7f16\u7e82\u4ee3\u7801\u7684\u76ee\u7684\u662f\u4f7f\u4ee3\u7801\u6108\u52a0\u660e\u6670\u3002 <\/p>\n
\u56e0\u4e3a\u7559\u7a7a\u683c\u6240\u53d1\u751f\u7684\u660e\u6670\u6027\u662f\u76f8\u5bf9\u7684\uff0c\u4e4b\u6240\u4ee5\uff0c\u5728\u5df2\u7ecf\u5341\u5206\u660e\u6670\u7684\u8bdd\u8bed\u4e2d\u6ca1\u6709\u5fc5\u8981\u518d\u7559\u7a7a\u683c\uff0c\u5982\u82e5\u8bdd\u8bed\u5df2\u8db3\u591f\u660e\u6670\u5219\u62ec\u53f7\u5185\u4fa7(\u5373\u5de6\u62ec\u53f7\u540e\u8fb9\u548c\u53f3\u62ec\u53f7\u524d\u65b9)\u4e0d\u9700\u8981\u52a0\u7a7a\u683c\uff0c\u591a\u91cd\u62ec\u53f7\u95f4\u4e0d\u987b\u52a0\u7a7a\u683c\uff0c\u7531\u4e8e\u5728C\/C++\u8bed\u8a00\u4e2d\u62ec\u53f7\u5df2\u7ecf\u662f\u6700\u660e\u6670\u7684\u6807\u793a\u4e86\u3002 <\/p>\n
\u5728\u957f\u8bdd\u8bed\u4e2d\uff0c\u5982\u5176\u4e9f\u9700\u6dfb\u7684\u7a7a\u683c\u5341\u5206\u591a\uff0c\u90a3\u4e48\u5e94\u5f53\u62a4\u6301\u901a\u4f53\u660e\u6670\uff0c\u800c\u5728\u5c40\u90e8\u4e0d\u52a0\u7a7a\u683c\u3002\u7ed9\u64cd\u4f5c\u7b26\u7559\u7a7a\u683c\u65f6\u4e0d\u7528\u63a5\u7eed\u7559\u4e24\u4e2a\u4e4b\u4e0a\u7a7a\u683c\u3002 <\/p>\n
\u793a\u8303\uff1a <\/p>\n
(\u4e00) \u9017\u53f7\u3001\u5206\u53f7\u53ea\u5728\u540e\u9762\u52a0\u7a7a\u683c\u3002 <\/p>\n
int a, b, c; <\/p>\n
(\u4e8c)\u6bd4\u8f83\u64cd\u4f5c\u7b26, \u8d4b\u503c\u64cd\u4f5c\u7b26\"=\"\u3001 \"+=\"\uff0c\u7b97\u672f\u64cd\u4f5c\u7b26\"+\"\u3001\"%\"\uff0c\u903b\u8f91\u64cd\u4f5c\u7b26\"&&\"\u3001\"&\"\uff0c\u4f4d\u57df\u64cd\u4f5c\u7b26\"<<\"\u3001\"^\"\u7b49\u53cc\u773c\u64cd\u4f5c\u7b26\u7684\u524d\u524d\u540e\u540e\u52a0\u7a7a\u683c\u3002 <\/p>\n
if (current_time >= MAX_TIME_VALUE) <\/p>\n
a = b + c; <\/p>\n
a *= \u4e8c; <\/p>\n
a = b ^ \u4e8c; <\/p>\n
(\u4e09)\"!\"\u3001\"~\"\u3001\"++\"\u3001\"--\"\u3001\"&\"\uff08\u5730\u5740\u6f14\u7b97\u7b26\uff09\u7b49\u5355\u76ee\u64cd\u4f5c\u7b26\u524d\u524d\u540e\u540e\u4e0d\u52a0\u7a7a\u683c\u3002 <\/p>\n
*p = 'a'; \/\/ \u5185\u5bb9\u64cd\u4f5c\"*\"\u4e0e\u5185\u5bb9\u5176\u95f4 <\/p>\n
flag = !isEmpty; \/\/ \u975e\u64cd\u4f5c\"!\"\u4e0e\u5185\u5bb9\u5176\u95f4 <\/p>\n
p = &mem; \/\/ \u5730\u5740\u64cd\u4f5c\"&\" \u4e0e\u5185\u5bb9\u5176\u95f4 <\/p>\n
i++; \/\/ \"++\",\"--\"\u4e0e\u5185\u5bb9\u5176\u95f4 <\/p>\n
(\u56db)\"->\"\u3001\".\"\u524d\u524d\u540e\u540e\u4e0d\u52a0\u7a7a\u683c\u3002 <\/p>\n
p->id = pid; \/\/ \"->\"\u6307\u9488\u524d\u524d\u540e\u540e\u4e0d\u52a0\u7a7a\u683c <\/p>\n
(\u4e94) if\u3001for\u3001while\u3001switch\u7b49\u4e0e\u540e\u8fb9\u7684\u62ec\u53f7\u95f4\u5e94\u52a0\u7a7a\u683c\uff0c\u4f7fif\u7b49\u5173\u952e\u5b57\u66f4\u5176\u7a81\u51fa\u3001\u663e\u7136\u3002 <\/p>\n
if (a >= b && c > d) <\/p>\n
\u00bd\u4e00-\u4e00\uff1a\u4e00\u8d77\u7a0b\u5e8f\u4ee5\u5c0f\u4e8e80\u5b57\u7b26\u4e3a\u5b9c\uff0c\u4e0d\u7528\u5199\u5f97\u8fc7\u957f\u3002 <\/p>\n
\u4e8c \u8be0\u91ca
\u00b9\u4e8c-\u4e00\uff1a\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u6e90\u7a0b\u5e8f\u6709\u6548\u8be0\u91ca\u91cf\u52a1\u5fc5\u572820\uff05\u4e4b\u4e0a\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u8be0\u91ca\u7684\u51c6\u5219\u662f\u6709\u52a9\u4e8e\u5bf9\u7a0b\u5e8f\u7684\u7ffb\u9605\u61c2\u5f97\uff0c\u5728\u8be5\u52a0\u7684\u5730\u65b9\u90fd\u52a0\u4e86\uff0c\u8be0\u91ca\u4e0d\u5b9c\u592a\u591a\u4e5f\u4e0d\u80fd\u592a\u5c11\uff0c\u8be0\u91ca\u8bed\u8a00\u52a1\u5fc5\u6b63\u786e\u3001\u6613\u61c2\u3001\u7b80\u660e\u3002 <\/p>\n
\u00b9\u4e8c-\u4e8c\uff1a\u8bf4\u660e\u6027\u8d44\u6599\uff08\u5982\u5934\u8d44\u6599.h\u8d44\u6599\u3001.inc\u8d44\u6599\u3001.def\u8d44\u6599\u3001\u7f16\u8bd1\u8bba\u8bf4\u6587\u4ef6.cfg\u7b49\uff09\u8111\u888b\u5e94\u5f00\u5c55\u8be0\u91ca\uff0c\u8be0\u91ca\u52a1\u987b\u5217\u51fa\uff1a\u7248\u6743\u8bf4\u660e\u3001\u7248\u672c\u53f7\u3001\u751f\u7ec8\u65e5\u671f\u3001\u5199\u7a3f\u4eba\u3001\u5185\u5bb9\u3001\u6548\u80fd\u3001\u4e0e\u5176\u8bf4\u5b83\u8d44\u6599\u7684\u5173\u7cfb\u3001\u6279\u6539\u65e5\u8bb0\u7b49\uff0c\u5934\u8d44\u6599\u7684\u8be0\u91ca\u4e2d\u8fd8\u5e94\u6709\u51fd\u6570\u6548\u80fd\u7b80\u660e\u8bf4\u660e\u3002 <\/p>\n
\u793a\u8303\uff1a\u5e95\u4e0b\u8fd9\u6bb5\u5934\u8d44\u6599\u7684\u5934\u8be0\u91ca\u6bd4\u8f83\u57fa\u51c6\uff0c\u5f53\u7136\uff0c\u5e76\u4e0d\u5c40\u9650\u4e8e\u6b64\u683c\u5f0f\uff0c\u4f46\u5982\u4e0a\u4fe1\u606f\u63d0\u8bae\u8981\u5305\u5b55\u5728\u5185\u3002 <\/p>\n
\/************************************************* <\/p>\n
Copyright (C), 1988-1999, Huawei Tech. Co., Ltd. <\/p>\n
File name: \/\/ \u6587\u4ef6\u540d <\/p>\n
Author: Version: Date: \/\/ \u8457\u8005\u3001\u7248\u672c\u53ca\u5b8c\u7ec8\u65e5\u671f <\/p>\n
Description: \/\/ \u7528\u6765\u8be6\u7ec6\u8bf4\u660e\u6b64\u7a0b\u9898\u8bcd\u4ef6\u5b8c\u6210\u7684\u91cd\u8981\u6548\u80fd\uff0c\u4e0e\u5176\u8bf4\u4ed6\u6a21\u5757 <\/p>\n
\/\/ \u6216\u51fd\u6570\u7684\u63a5\u53e3\uff0c\u8f93\u51fa\u503c\u3001\u53d6\u503c\u8303\u7574\u3001\u542b\u610f\u53ca\u53c2\u6570\u95f4\u7684\u63a7 <\/p>\n
\/\/ \u5236\u3001\u987a\u5e8f\u3001\u72ec\u529b\u6216\u59d4\u4ee5\u7b49\u5173\u7cfb <\/p>\n
Others: \/\/ \u5176\u5b83\u5185\u5bb9\u7684\u8bf4\u660e <\/p>\n
Function List: \/\/ \u91cd\u8981\u51fd\u6570\u5217\u8868\uff0c\u6bcf\u6761\u8bb0\u8981\u5e94\u5305\u62ec\u51fd\u6570\u540d\u53ca\u6548\u80fd\u7b80\u660e\u8bf4\u660e <\/p>\n
1. .... <\/p>\n
History: \/\/ \u6279\u6539\u5386\u53f2\u8bb0\u5f55\u5217\u8868\uff0c\u6bcf\u6761\u6279\u6539\u8bb0\u8981\u5e94\u5305\u62ec\u6279\u6539\u65e5\u671f\u3001\u6279\u6539 <\/p>\n
\/\/ \u8005\u53ca\u6279\u6539\u5185\u5bb9\u7b80\u8ff0 <\/p>\n
1. Date: <\/p>\n
Author: <\/p>\n
Modification: <\/p>\n
2. ... <\/p>\n
*************************************************\/ <\/p>\n
\u00b9\u4e8c-\u4e09\uff1a\u6e90\u6587\u4ef6\u8111\u888b\u5e94\u8fdb\u5c55\u8be0\u91ca\uff0c\u5217\u51fa\uff1a\u7248\u6743\u8bf4\u660e\u3001\u7248\u672c\u53f7\u3001\u751f\u7ec8\u65e5\u671f\u3001\u8d77\u8349\u4eba\u3001\u6a21\u5757\u76ee\u7684\/\u6548\u80fd\u3001\u91cd\u8981\u51fd\u6570\u53ca\u5176\u6548\u80fd\u3001\u6279\u6539\u65e5\u8bb0\u7b49\u3002 <\/p>\n
\u793a\u8303\uff1a\u4e0b\u5934\u8fd9\u6bb5\u6e90\u6587\u4ef6\u7684\u5934\u8be0\u91ca\u6bd4\u8f83\u57fa\u51c6\uff0c\u5f53\u7136\uff0c\u5e76\u4e0d\u5c40\u9650\u4e8e\u6b64\u683c\u5f0f\uff0c\u4f46\u5982\u4e0a\u4fe1\u606f\u63d0\u8bae\u8981\u5305\u5b55\u5728\u5185\u3002 <\/p>\n
\/************************************************************ <\/p>\n
Copyright (C), 1988-1999, Huawei Tech. Co., Ltd. <\/p>\n
FileName: test.cpp <\/p>\n
Author: Version : Date: <\/p>\n
Description: \/\/ \u6a21\u5757\u63cf\u8ff0 <\/p>\n
Version: \/\/ \u7248\u672c\u4fe1\u606f <\/p>\n
Function List: \/\/ \u91cd\u8981\u51fd\u6570\u53ca\u5176\u6548\u80fd <\/p>\n
1. ------- <\/p>\n
History: \/\/ \u5386\u53f2\u6279\u6539\u8bb0\u8981 <\/p>\n
David 96\/10\/12 1.0 build this moudle <\/p>\n
***********************************************************\/ <\/p>\n
\u8bf4\u660e\uff1aDescription\u4e00\u9879\u63cf\u8ff0\u6b63\u6587\u4ef6\u7684\u5185\u5bb9\u3001\u6548\u80fd\u3001\u5185\u90e8\u5404\u90e8\u5206\u5176\u95f4\u7684\u5173\u7cfb\u53ca\u6b63\u6587\u4ef6\u6bcb\u5b81\u5b83\u8d44\u6599\u5173\u7cfb\u7b49\u3002History\u662f\u6279\u6539\u5386\u53f2\u8bb0\u5f55\u5217\u8868\uff0c\u6bcf\u6761\u6279\u6539\u8bb0\u8981\u5e94\u5305\u62ec\u6279\u6539\u65e5\u671f\u3001\u6279\u6539\u8005\u53ca\u6279\u6539\u5185\u5bb9\u7b80\u8ff0\u3002 <\/p>\n
\u00b9\u4e8c-\u56db\uff1a\u51fd\u6570\u8111\u888b\u5e94\u8fdb\u5c55\u8be0\u91ca\uff0c\u5217\u51fa\uff1a\u51fd\u6570\u7684\u76ee\u7684\/\u6548\u80fd\u3001\u8f93\u5165\u53c2\u6570\u3001\u8f93\u51fa\u53c2\u6570\u3001\u56de\u6765\u503c\u3001\u8c03\u7528\u5173\u7cfb\uff08\u51fd\u6570\u3001\u8868\uff09\u7b49\u3002 <\/p>\n
\u793a\u8303\uff1a\u4e0b\u8fb9\u8fd9\u6bb5\u51fd\u6570\u7684\u8be0\u91ca\u6bd4\u8f83\u57fa\u51c6\uff0c\u5f53\u7136\uff0c\u5e76\u4e0d\u5c40\u9650\u4e8e\u6b64\u683c\u5f0f\uff0c\u4f46\u5982\u4e0a\u4fe1\u606f\u63d0\u8bae\u8981\u5305\u5b55\u5728\u5185\u3002 <\/p>\n
\/************************************************* <\/p>\n
Function: \/\/ \u51fd\u6570\u59d3\u540d <\/p>\n
Description: \/\/ \u51fd\u6570\u6548\u80fd\u3001\u6027\u80fd\u7b49\u7684\u63cf\u8ff0 <\/p>\n
Calls: \/\/ \u88ab\u672c\u51fd\u6570\u8c03\u7528\u7684\u51fd\u6570\u6e05\u5355 <\/p>\n
Called By: \/\/ \u8c03\u7528\u672c\u51fd\u6570\u7684\u51fd\u6570\u6e05\u5355 <\/p>\n
Table Accessed: \/\/ \u88ab\u8bbf\u95ee\u7684\u8868\uff08\u6b64\u9879\u4ec5\u5173\u4e8e\u7275\u8fde\u5230\u6570\u636e\u5e93\u64cd\u4f5c\u7684\u7a0b\u5e8f\uff09 <\/p>\n
Table Updated: \/\/ \u88ab\u6279\u6539\u7684\u8868\uff08\u6b64\u9879\u4ec5\u5173\u4e8e\u7275\u6d89\u5230\u6570\u636e\u5e93\u64cd\u4f5c\u7684\u7a0b\u5e8f\uff09 <\/p>\n
Input: \/\/ \u8f93\u5165\u53c2\u6570\u53e8\u660e\uff0c\u5305\u62ec\u6bcf\u4e2a\u53c2\u6570\u7684\u505a <\/p>\n
\/\/ \u7528\u3001\u53d6\u503c\u8bf4\u660e\u53ca\u53c2\u6570\u95f4\u5173\u7cfb\u3002 <\/p>\n
Output: \/\/ \u5bf9\u8f93\u51fa\u53c2\u6570\u7684\u8bf4\u660e\u3002 <\/p>\n
Return: \/\/ \u51fd\u6570\u56de\u6765\u503c\u7684\u8bf4\u660e <\/p>\n
Others: \/\/ \u5176\u5b83\u8bf4\u660e <\/p>\n
*************************************************\/ <\/p>\n
\u00b9\u4e8c-\u4e94\uff1a\u8fb9\u5199\u4ee3\u7801\u8fb9\u8be0\u91ca\uff0c\u6279\u6539\u4ee3\u7801\u4e0e\u6b64\u540c\u65f6\u6279\u6539\u547c\u5e94\u7684\u8be0\u91ca\uff0c\u4ee5\u519b\u4ee4\u72b6\u8be0\u91ca\u4e0e\u4ee3\u7801\u7684\u4e00\u81f4\u6027\u3002\u4e0d\u8fd8\u6709\u7528\u7684\u8be0\u91ca\u8981\u5254\u9664\u3002 <\/p>\n
\u00b9\u4e8c-\u516d\uff1a\u8be0\u91ca\u7684\u5185\u5bb9\u8981\u660e\u767d\u3001\u4e86\u7136\uff0c\u542b\u610f\u6b63\u786e\uff0c\u9632\u6b62\u8be0\u91ca2\u4e49\u6027\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u5dee\u9519\u7684\u8be0\u91ca\u975e\u4f46\u65e0\u76ca\u53cd\u662f\u6709\u5bb3\u3002 <\/p>\n
\u89c4\u7ea6\u4e8c-\u4e03\uff1a\u907f\u514d\u5728\u8be0\u91ca\u4e2d\u5e94\u7528\u7f29\u5199\uff0c\u7279\u522b\u662f\u662f\u975e\u975e\u60ef\u7528\u7f29\u5199\u3002
\u8bf4\u660e\uff1a\u5728\u5e94\u7528\u7f29\u5199\u65f6\u6216\u4e8b\u5148\uff0c\u5e94\u5bf9\u7f29\u5199\u5f00\u5c55\u5fc5\u8981\u7684\u8bf4\u660e\u3002 <\/p>\n
\u00b9\u4e8c-\u516b\uff1a\u8be0\u91ca\u5e94\u4e0e\u5176\u8bf4\u63cf\u8ff0\u7684\u4ee3\u7801\u4e34\u8fd1\uff0c\u5bf9\u4ee3\u7801\u7684\u8be0\u91ca\u5e94\u653e\u5728\u5176\u4e0a\u65b9\u6216\u53f3\u8fb9\uff08\u5bf9\u5355\u6761\u8bdd\u8bed\u7684\u8be0\u91ca\uff09\u7d27\u90bb\u4f4d\u7f6e\uff0c\u4e0d\u53ef\u653e\u9119\u4eba\u9762\uff0c\u5982\u653e\u4e8e\u4e0a\u65b9\u5219\u9700\u4e0e\u5176\u8bf4\u4e0a\u5934\u7684\u4ee3\u7801\u7528\u7a7a\u884c\u9694\u5f00\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u4f8b\u8bc1\u4e0d\u7b26\u5408\u8f68\u8303\u3002 <\/p>\n
\u4f8b\u4e00\uff1a <\/p>\n
\/* get replicate sub system index and net indicator *\/ <\/p>\n
repssn_ind = ssn_data[index].repssn_index; <\/p>\n
repssn_ni = ssn_data[index].ni; <\/p>\n
\u4f8b\u4e8c\uff1a <\/p>\n
repssn_ind = ssn_data[index].repssn_index; <\/p>\n
repssn_ni = ssn_data[index].ni; <\/p>\n
\/* get replicate sub system index and net indicator *\/ <\/p>\n
\u5f53\u5982\u6b21\u4e66\u5199 <\/p>\n
\/* get replicate sub system index and net indicator *\/ <\/p>\n
repssn_ind = ssn_data[index].repssn_index; <\/p>\n
repssn_ni = ssn_data[index].ni; <\/p>\n
\u00b9\u4e8c-\u4e5d\uff1a\u5173\u4e8e\u5168\u90e8\u6709\u7269\u7406\u542b\u610f\u7684\u53d8\u91cf\u3001\u6052\u91cf\uff0c\u5982\u5176\u5176\u5b9a\u540d\u4e0d\u662f\u5145\u5206\u81ea\u8be0\u91ca\u7684\uff0c\u5728\u5ba3\u8a00\u65f6\u90fd\u5fc5\u987b\u52a0\u4ee5\u8be0\u91ca\uff0c\u8bf4\u660e\u5176\u7269\u7406\u542b\u610f\u3002\u53d8\u91cf\u3001\u6052\u91cf\u3001\u5b8f\u7684\u8be0\u91ca\u5e94\u653e\u5728\u5176\u4e0a\u65b9\u7d27\u90bb\u4f4d\u7f6e\u6216\u53f3\u8fb9\u3002 <\/p>\n
\u793a\u8303\uff1a <\/p>\n
\/* active statistic task number *\/ <\/p>\n
#define MAX_ACT_TASK_NUMBER 1000 <\/p>\n
#define MAX_ACT_TASK_NUMBER 1000 \/* active statistic task number *\/ <\/p>\n
\u00b9\u4e8c-\u5341\uff1a\u6570\u636e\u7ed3\u6784\u5ba3\u8a00(\u5305\u62ec\u6570\u7ec4\u3001\u6784\u9020\u3001\u79cd\u3001\u679a\u4e3e\u7b49)\uff0c\u5982\u5176\u5176\u5b9a\u540d\u4e0d\u662f\u5145\u5206\u81ea\u8be0\u91ca\u7684\uff0c\u52a1\u5fc5\u52a0\u4ee5\u8be0\u91ca\u3002\u5bf9\u6570\u636e\u7ed3\u6784\u7684\u8be0\u91ca\u5e94\u653e\u5728\u5176\u4e0a\u65b9\u7d27\u90bb\u4f4d\u7f6e\uff0c\u4e0d\u53ef\u653e\u9119\u4eba\u9762\uff1b\u5bf9\u6784\u9020\u4e2d\u7684\u6bcf\u4e2a\u57df\u7684\u8be0\u91ca\u653e\u5728\u6b64\u57df\u7684\u53f3\u9996\u3002 <\/p>\n
\u793a\u8303\uff1a\u53ef\u6309\u5982\u6b21\u6a21\u5f0f\u8bf4\u660e\u679a\u4e3e\/\u6570\u636e\/\u8054\u5408\u7ed3\u6784\u3002 <\/p>\n
\/* sccp interface with sccp user primitive message name *\/ <\/p>\n
enum SCCP_USER_PRIMITIVE <\/p>\n
{ <\/p>\n
N_UNITDATA_IND, \/* sccp notify sccp user unit data come *\/ <\/p>\n
N_NOTICE_IND, \/* sccp notify user the No.\u4e03 network can not *\/ <\/p>\n
\/* transmission this message *\/ <\/p>\n
N_UNITDATA_REQ, \/* sccp user's unit data transmission request*\/ <\/p>\n
}; <\/p>\n
\u00b9\u4e8c-11\uff1a\u5168\u5c40\u53d8\u91cf\u8981\u6709\u8f83\u8be6\u7ec6\u7684\u8be0\u91ca\uff0c\u5305\u62ec\u5bf9\u5176\u6548\u80fd\u3001\u53d6\u503c\u8303\u7574\u3001\u54ea\u4e9b\u51fd\u6570\u6216\u5386\u7a0b\u5b58\u53d6\u5b83\u4ee5\u53ca\u5b58\u53d6\u65f6\u6ce8\u610f\u4e8b\u9879\u7b49\u7684\u8bf4\u660e\u3002 <\/p>\n
\u793a\u8303\uff1a <\/p>\n
\/* The ErrorCode when SCCP translate *\/ <\/p>\n
\/* Global Title failure, as follows *\/ \/\/ \u53d8\u91cf\u529f\u7528\u3001\u542b\u610f <\/p>\n
\/* \u96f6 \uff0d SUCCESS \u4e00 \uff0d GT Table error *\/ <\/p>\n
\/* \u4e8c \uff0d GT error Others \uff0d no use *\/ \/\/ \u53d8\u91cf\u53d6\u503c\u8303\u7574 <\/p>\n
\/* only function SCCPTranslate() in *\/ <\/p>\n
\/* this modual can modify it, and other *\/ <\/p>\n
\/* module can visit it through call *\/ <\/p>\n
\/* the function GetGTTransErrorCode() *\/ \/\/ \u4f7f\u7528\u65b9\u6cd5 <\/p>\n
BYTE g_GTTranErrorCode; <\/p>\n
\u00b9\u4e8c-12\uff1a\u8be0\u91ca\u4e0e\u6240\u63cf\u8ff0\u5185\u5bb9\u5f00\u5c55\u4e00\u6837\u7684\u7f29\u6392\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u53ef\u4f7f\u7a0b\u5e8f\u6392\u5b57\u9f50\u6574\uff0c\u5e76\u4fbf\u5229\u8be0\u91ca\u7684\u9605\u89c8\u4e0e\u4e86\u89e3\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u4f8b\u8bc1\uff0c\u6392\u5b57\u4e0d\u6574\u9f50\uff0c\u7ffb\u9605\u7a0d\u611f\u4e0d\u4fbf\u3002 <\/p>\n
void example_fun( void ) <\/p>\n
{ <\/p>\n
\/* code one comments *\/ <\/p>\n
CodeBlock One <\/p>\n
\/* code two comments *\/ <\/p>\n
CodeBlock Two <\/p>\n
} <\/p>\n
\u5f53\u6539\u6210\u5982\u6b21\u683c\u5c40\u3002 <\/p>\n
void example_fun( void ) <\/p>\n
{ <\/p>\n
\/* code one comments *\/ <\/p>\n
CodeBlock One <\/p>\n
\/* code two comments *\/ <\/p>\n
CodeBlock Two <\/p>\n
} <\/p>\n
\u00b9\u4e8c-13\uff1a\u5c06\u8be0\u91ca\u4e0e\u5176\u8bf4\u4e0a\u8fb9\u7684\u4ee3\u7801\u7528\u7a7a\u884c\u9694\u5f00\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u4f8b\u8bc1\uff0c\u663e\u5f97\u4ee3\u7801\u8fc7\u4e8e\u7d27\u51d1\u3002 <\/p>\n
\/* code one comments *\/ <\/p>\n
program code one <\/p>\n
\/* code two comments *\/ <\/p>\n
program code two <\/p>\n
\u5f53\u5982\u6b21\u4e66\u5199 <\/p>\n
\/* code one comments *\/ <\/p>\n
program code one <\/p>\n
\/* code two comments *\/ <\/p>\n
program code two <\/p>\n
\u00b9\u4e8c-14\uff1a\u5bf9\u53d8\u91cf\u7684\u5b9a\u4e49\u548c\u65c1\u652f\u8bdd\u8bed\uff08\u6761\u4ef6\u65c1\u652f\u3001\u5faa\u73af\u8bdd\u8bed\u7b49\uff09\u52a1\u987b\u7f16\u7e82\u8be0\u91ca\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u8fd9\u4e9b\u8bdd\u8bed\u5f80\u5f80\u662f\u7a0b\u5e8f\u5151\u73b0\u67d0\u4e00\u7279\u5b9a\u6548\u80fd\u7684\u8981\u5bb3\uff0c\u81f3\u4e8e\u7ef4\u62a4\u4eba\u5458\u6765\u8bf4\uff0c\u5f88\u597d\u7684\u8be0\u91ca\u76f8\u52a9\u66f4\u597d\u7684\u61c2\u5f97\u7a0b\u5e8f\uff0c\u6709\u65f6\u5019\u751a\u6216\u4f18\u4e8e\u770b\u8bbe\u8ba1\u6587\u6863\u3002 <\/p>\n
\u00b9\u4e8c-15\uff1a\u5173\u4e8eswitch\u8bdd\u8bed\u505c\u7684case\u8bdd\u8bed\uff0c\u5982\u5176\u7531\u4e8e\u7279\u6b8a\u60c5\u51b5\u4e9f\u9700\u5904\u7f6e\u5b8c\u4e00\u4e2acase\u540e\u8fdb\u53bb\u4e0b\u4e00\u4e2acase\u5904\u7f6e\uff0c\u52a1\u987b\u5728\u8be5case\u8bdd\u8bed\u5904\u7406\u5b8c\u3001\u4e0b\u4e00\u4e2acase\u8bdd\u8bed\u524d\u52a0\u4e0a\u660e\u786e\u7684\u8be0\u91ca\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u8fd9\u4e48\u6bd4\u8f83\u6e05\u695a\u7a0b\u5e8f\u7f16\u8f91\u8005\u7684\u4f01\u56fe\uff0c\u6709\u6548\u9632\u6b62\u5e73\u767d\u65e0\u6545\u758f\u6f0fbreak\u8bdd\u8bed\u3002 <\/p>\n
\u793a\u8303\uff08\u6ce8\u610f\u659c\u4f53\u52a0\u7c97\u4e00\u90e8\u5206\uff09\uff1a <\/p>\n
case CMD_UP: <\/p>\n
ProcessUp(); <\/p>\n
break; <\/p>\n
case CMD_DOWN: <\/p>\n
ProcessDown(); <\/p>\n
break; <\/p>\n
case CMD_FWD: <\/p>\n
ProcessFwd(); <\/p>\n
if (...) <\/p>\n
{ <\/p>\n
... <\/p>\n
break; <\/p>\n
} <\/p>\n
else <\/p>\n
{ <\/p>\n
ProcessCFW_B(); \/\/ now jump into case CMD_A <\/p>\n
} <\/p>\n
case CMD_A: <\/p>\n
ProcessA(); <\/p>\n
break; <\/p>\n
case CMD_B: <\/p>\n
ProcessB(); <\/p>\n
break; <\/p>\n
case CMD_C: <\/p>\n
ProcessC(); <\/p>\n
break; <\/p>\n
case CMD_D: <\/p>\n
ProcessD(); <\/p>\n
break; <\/p>\n
... <\/p>\n
\u00bd\u4e8c-\u4e00\uff1a\u907f\u514d\u5728\u4e00\u8d77\u4ee3\u7801\u6216\u8868\u8fbe\u5f0f\u7684\u5f53\u4e2d\u5b89\u63d2\u8be0\u91ca\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u9664\u975e\u5fc5\u8981\uff0c\u4e0d\u5e94\u5728\u4ee3\u7801\u6216\u8868\u8ff0\u5f53\u4e2d\u5b89\u63d2\u8be0\u91ca\uff0c\u4e0d\u7136\u7b80\u5355\u4f7f\u4ee3\u7801\u53ef\u7406\u89e3\u6027\u53d8\u5dee\u3002 <\/p>\n
\u00bd\u4e8c-\u4e8c\uff1a\u7ecf\u8fc7\u5bf9\u51fd\u6570\u6216\u8fdb\u7a0b\u3001\u53d8\u91cf\u3001\u6784\u9020\u7b49\u51c6\u786e\u7684\u5b9a\u540d\u4ee5\u53ca\u5408\u7406\u5730\u90e8\u95e8\u4ee3\u7801\u7684\u6784\u9020\uff0c\u4f7f\u4ee3\u7801\u53d8\u4e3a\u81ea\u8be0\u91ca\u7684\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u660e\u6670\u6b63\u786e\u7684\u51fd\u6570\u3001\u53d8\u91cf\u7b49\u7684\u5b9a\u540d\uff0c\u53ef\u589e\u52a0\u4ee3\u7801\u53ef\u8bfb\u6027\uff0c\u5e76\u51cf\u5c0f\u7528\u4e0d\u7740\u7684\u8be0\u91ca\u3002 <\/p>\n
\u00bd\u4e8c-\u4e09\uff1a\u5728\u4ee3\u7801\u7684\u6548\u80fd\u3001\u4f01\u56fe\u5c42\u6b21\u957f\u8fdb\u884c\u8be0\u91ca\uff0c\u63d0\u4f9b\u6709\u7528\u3001\u989d\u5916\u7684\u4fe1\u606f\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u8be0\u91ca\u7684\u76ee\u7684\u662f\u89e3\u91ca\u4ee3\u7801\u7684\u76ee\u7684\u3001\u6548\u80fd\u548c\u91c7\u53d6\u7684\u6b65\u9aa4\uff0c\u63d0\u4f9b\u4ee3\u7801\u4e4b\u5916\u7684\u4fe1\u606f\uff0c\u76f8\u52a9\u8bfb\u8005\u4e86\u89e3\u4ee3\u7801\uff0c\u9632\u6b62\u6ca1\u5fc5\u8981\u7684\u53cd\u590d\u8be0\u91ca\u4fe1\u606f\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u8be0\u91ca\u610f\u601d\u4e0d\u5927\u3002 <\/p>\n
\/* if receive_flag is TRUE *\/ <\/p>\n
if (receive_flag) <\/p>\n
\u800c\u5982\u6b21\u7684\u8be0\u91ca\u5219\u4ed8\u51fa\u4e86\u989d\u5916\u6709\u7528\u7684\u4fe1\u606f\u3002 <\/p>\n
\/* if mtp receive a message from links *\/ <\/p>\n
if (receive_flag) <\/p>\n
\u00bd\u4e8c-\u56db\uff1a\u5728\u7a0b\u5e8f\u5757\u7684\u5b8c\u7ed3\u884c\u53f3\u8fb9\u52a0\u8be0\u91ca\u6807\u8bb0\uff0c\u4ee5\u8868\u660e\u67d0\u7a0b\u5e8f\u5757\u7684\u5b8c\u7ed3\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u73b0\u4ee3\u7801\u6bb5\u8f83\u957f\uff0c\u7279\u522b\u662f\u591a\u91cd\u5d4c\u5957\u65f6\uff0c\u8fd9\u4e48\u5e72\u53ef\u4ee5\u4f7f\u4ee3\u7801\u66f4\u660e\u6670\uff0c\u66f4\u6613\u4e8e\u9605\u89c8\u3002 <\/p>\n
\u793a\u8303\uff1a\u53c2\u770b\u5982\u6b21\u4f8b\u8bc1\u3002 <\/p>\n
if (...) <\/p>\n
{ <\/p>\n
\/\/ program code <\/p>\n
while (index < MAX_INDEX) <\/p>\n
{ <\/p>\n
\/\/ program code <\/p>\n
} \/* end of while (index < MAX_INDEX) *\/ \/\/ \u70b9\u660e\u8be5\u6761while\u8bdd\u8bed\u5b8c\u4e86 <\/p>\n
} \/* end of if (...)*\/ \/\/ \u70b9\u660e\u662f\u54ea\u6761if\u8bdd\u8bed\u5b8c\u4e86 <\/p>\n
\u00bd\u4e8c-\u4e94\uff1a\u8be0\u91ca\u683c\u5f0f\u5c3d\u53ef\u80fd\u4e00\u81f4\uff0c\u63d0\u8bae\u8fd0\u7528\u201c\/* \u2026\u2026 *\/\u201d\u3002 <\/p>\n
\u00bd\u4e8c-\u516d\uff1a\u8be0\u91ca\u5e94\u8bd5\u8651\u7a0b\u5e8f\u6613\u8bfb\u53ca\u5916\u89c2\u6392\u5b57\u7684\u8981\u7d20\uff0c\u8fd0\u7528\u7684\u8bed\u8a00\u8981\u662f\u4e2d\u3001\u82f1\u517c\u5177\u7684\uff0c\u63d0\u8bae\u591a\u8fd0\u7528\u6c49\u8bed\u8a00\uff0c\u9664\u975e\u80fd\u7528\u5341\u5206\u6d41\u7545\u6b63\u786e\u7684\u82f1\u6587\u8868\u8ff0\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u8be0\u91ca\u8bed\u8a00\u4e0d\u4e00\u81f4\uff0c\u5f71\u54cd\u7a0b\u5e8f\u6613\u8bfb\u6027\u548c\u5916\u89c2\u6392\u5b57\uff0c\u9274\u4e8e\u5bf9\u7ef4\u62a4\u4eba\u5458\u7684\u601d\u5fd6\uff0c\u63d0\u8bae\u5e94\u7528\u6c49\u8bed\u8a00\u3002 <\/p>\n
\u4e09 \u6807\u8bc6\u7b26\u5b9a\u540d
\u00b9\u4e09-\u4e00\uff1a\u6807\u8bc6\u7b26\u7684\u5b9a\u540d\u8981\u660e\u6670\u3001\u4e86\u7136\uff0c\u6709\u660e\u786e\u542b\u610f\uff0c\u4e0e\u6b64\u540c\u65f6\u5e94\u7528\u5b8c\u6574\u7684\u5355\u7eaf\u8bcd\u6216\u5927\u4f19\u513f\u6839\u672c\u53ef\u4ee5\u61c2\u5f97\u7684\u7f29\u5199\uff0c\u907f\u514d\u4f7f\u4eba\u4ea7\u751f\u8bef\u89e3\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u8f83\u77ed\u7684\u5355\u7eaf\u8bcd\u53ef\u901a\u8fc7\u53bb\u6389\u201c\u5143\u97f3\u201d\u5f62\u6210\u7f29\u5199\uff1b\u8f83\u957f\u7684\u5355\u7eaf\u8bcd\u53ef\u53d6\u5355\u7eaf\u8bcd\u7684\u5934\u51e0\u4e2a\u5b57\u6bcd\u5f62\u6210\u7f29\u5199\uff1b\u4e00\u4e9b\u5355\u7eaf\u8bcd\u6709\u5927\u4f19\u513f\u4e00\u81f4\u627f\u8ba4\u7684\u7f29\u5199\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u5355\u7eaf\u8bcd\u7684\u7f29\u5199\u80fd\u591f\u88ab\u5927\u4f19\u6839\u672c\u8ba4\u540c\u3002 <\/p>\n
temp \u53ef\u7f29\u5199\u4e3a tmp ; <\/p>\n
flag \u53ef\u7f29\u5199\u4e3a flg ; <\/p>\n
statistic \u53ef\u7f29\u5199\u4e3a stat ; <\/p>\n
increment \u53ef\u7f29\u5199\u4e3a inc ; <\/p>\n
message \u53ef\u7f29\u5199\u4e3a msg ; <\/p>\n
\u00b9\u4e09-\u4e8c\uff1a\u5b9a\u540d\u4e2d\u82e5\u5e94\u7528\u975e\u4e00\u822c\u7ea6\u5b9a\u6216\u7f29\u5199\uff0c\u5219\u8981\u6709\u8be0\u91ca\u8bf4\u660e\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u5e94\u8be5\u5728\u6e90\u6587\u4ef6\u7684\u5f00\u59cb\u4e4b\u5904\uff0c\u5bf9\u8d44\u6599\u4e2d\u6240\u65bd\u7528\u7684\u7f29\u5199\u6216\u7ea6\u5b9a\uff0c\u7279\u522b\u662f\u975e\u4e00\u822c\u7684\u7f29\u5199\uff0c\u5f00\u5c55\u5fc5\u8981\u7684\u8be0\u91ca\u8bf4\u660e\u3002 <\/p>\n
\u00b9\u4e09-\u4e09\uff1a\u81ea\u5404\u513f\u7279\u6709\u7684\u5b9a\u540d\u4f5c\u98ce\uff0c\u8981\u59cb\u7ec8\u5982\u4e00\u4fdd\u6301\u4e00\u81f4\uff0c\u4e0d\u53ef\u6765\u56de\u53d8\u66f4\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u4e2a\u4eba\u7684\u5b9a\u540d\u4f5c\u98ce\uff0c\u5728\u543b\u5408\u6240\u5728\u9879\u76ee\u7ec4\u6216\u4ea7\u54c1\u7ec4\u7684\u5b9a\u540d\u5b88\u5219\u7684\u524d\u63d0\u4e0b\uff0c\u624d\u53ef\u5e94\u7528\u3002\uff08\u5373\u5b9a\u540d\u5b88\u5219\u4e2d\u6ca1\u89c4\u5b9a\u5230\u7684\u5730\u521a\u624d\u53ef\u6709\u4e2a\u6c11\u547d\u540d\u4f5c\u6d3e\uff09\u3002 <\/p>\n
\u00b9\u4e09-\u56db\uff1a\u5173\u4e8e\u53d8\u91cf\u5b9a\u540d\uff0c\u7981\u6b62\u53d6\u5355\u4e2a\u5b57\u7b26\uff08\u5982i\u3001j\u3001k...\uff09\uff0c\u63d0\u8bae\u9664\u5f00\u8981\u6709\u5177\u4f53\u542b\u610f\u5916\uff0c\u8fd8\u80fd\u8868\u660e\u5176\u53d8\u91cf\u90e8\u7c7b\u3001\u6570\u636e\u95e8\u7c7b\u7b49\uff0c\u4f46i\u3001j\u3001k\u505a\u5c40\u90e8\u5faa\u73af\u53d8\u91cf\u662f\u5bb9\u8bb8\u7684\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u53d8\u91cf\uff0c\u5c24\u5176\u662f\u5c40\u90e8\u53d8\u91cf\uff0c\u5982\u5176\u7528\u5355\u4e2a\u5b57\u7b26\u793a\u610f\uff0c\u5f88\u7b80\u7565\u6572\u9519\uff08\u5982i\u5199\u6210j\uff09\uff0c\u800c\u7f16\u8bd1\u65f6\u53c8\u7a3d\u67e5\u4e0d\u51fa\u6765\uff0c\u6709\u6216\u8bb8\u4e3a\u4e86\u8fd9\u4e2a\u5f88\u5c0f\u5dee\u9519\u800c\u5f00\u9500\u5927\u91cf\u7684\u67e5\u9519\u65f6\u95f4\u3002 <\/p>\n
\u793a\u8303\uff1a\u4e0b\u8fb9\u6240\u793a\u7684\u5c40\u90e8\u53d8\u91cf\u540d\u7684\u5b9a\u4e49\u6b65\u9aa4\u53ef\u4ee5\u9f9f\u9274\u3002 <\/p>\n
int liv_Width <\/p>\n
\u5176\u53d8\u91cf\u540d\u89e3\u91ca\u5982\u6b21\uff1a <\/p>\n
l \u5c40\u90e8\u53d8\u91cf\uff08Local\uff09 \uff08\u5176\u5b83\uff1ag \u5168\u5c40\u53d8\u91cf\uff08Global\uff09...\uff09 <\/p>\n
i \u6570\u636e\u90e8\u7c7b\uff08Interger\uff09 <\/p>\n
v \u53d8\u91cf\uff08Variable\uff09 \uff08\u5176\u5b83\uff1ac \u6052\u91cf\uff08Const\uff09...\uff09 <\/p>\n
Width \u53d8\u91cf\u542b\u610f <\/p>\n
\u8fd9\u4e48\u53ef\u4ee5\u9632\u6b62\u5c40\u90e8\u53d8\u91cf\u4e0e\u5168\u5c40\u53d8\u91cf\u91cd\u540d\u3002 <\/p>\n
\u00b9\u4e09-\u4e94\uff1a\u5b9a\u540d\u8f68\u8303\u52a1\u5fc5\u4e0e\u6240\u5e94\u7528\u7684\u7cfb\u7edf\u4f5c\u6d3e\u4fdd\u6301\u4e00\u81f4\uff0c\u5e76\u5728\u540c\u4e00\u9879\u76ee\u4e2d\u4e00\u81f4\uff0c\u4f8b\u5982\u91c7\u53d6UNIX\u7684\u5168\u5c0f\u5199\u52a0\u4e0b\u5212\u7ebf\u7684\u4f5c\u6d3e\u6216\u5927\u5c0f\u5199\u6df7\u6392\u7684\u5f62\u5f0f\uff0c\u4e0d\u7528\u65bd\u7528\u5927\u5c0f\u5199\u4e0e\u4e0b\u5212\u7ebf\u6df7\u6392\u7684\u5f62\u5f0f\uff0c\u89c6\u4f5c\u975e\u4e00\u822c\u6807\u8bc6\u5982\u6807\u8bc6\u6210\u5458\u53d8\u91cf\u6216\u5168\u5c40\u53d8\u91cf\u7684m_\u548cg_\uff0c\u7136\u540e\u52a0\u4e0a\u5927\u5c0f\u5199\u6df7\u6392\u7684\u6a21\u5f0f\u662f\u5bb9\u8bb8\u7684\u3002 <\/p>\n
\u793a\u8303\uff1a Add_User\u4e0d\u5141\u8bb8\uff0cadd_user\u3001AddUser\u3001m_AddUser\u5bb9\u8bb8\u3002 <\/p>\n
\u00bd\u4e09-\u4e00\uff1a\u9664\u975e\u5fc5\u8981\uff0c\u4e0d\u7528\u7528\u6570\u76ee\u5b57\u6216\u8f83\u6bd4\u5947\u602a\u7684\u5b57\u7b26\u6765\u5b9a\u4e49\u6807\u8bc6\u7b26\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u5b9a\u540d\uff0c\u4f7f\u4eba\u53d1\u751f\u56f0\u60d1\u3002 <\/p>\n
#define _EXAMPLE_\u96f6_TEST_ <\/p>\n
#define _EXAMPLE_\u4e00_TEST_ <\/p>\n
void set_sls00( BYTE sls ); <\/p>\n
\u5f53\u6539\u6210\u6545\u610f\u4e49\u7684\u5355\u7eaf\u8bcd\u5b9a\u540d <\/p>\n
#define _EXAMPLE_UNIT_TEST_ <\/p>\n
#define _EXAMPLE_ASSERT_TEST_ <\/p>\n
void set_udt_msg_sls( BYTE sls ); <\/p>\n
\u00bd\u4e09-\u4e8c\uff1a\u5728\u540c\u4e00\u8f6f\u4ef6\u4ea7\u54c1\u5185\uff0c\u5f53\u89c4\u5212\u597d\u63a5\u53e3\u4e00\u90e8\u5206\u6807\u8bc6\u7b26\uff08\u53d8\u91cf\u3001\u6784\u9020\u3001\u51fd\u6570\u53ca\u6052\u91cf\uff09\u7684\u5b9a\u540d\uff0c\u9632\u6b62\u7f16\u8bd1\u3001\u94fe\u63a5\u65f6\u53d1\u751f\u6469\u64e6\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u8854\u63a5\u53e3\u4e00\u90e8\u5206\u7684\u6807\u8bc6\u7b26\u5e94\u8be5\u6709\u66f4\u4e25\u5389\u9650\u5236\uff0c\u9632\u6b62\u6469\u64e6\u3002\u5982\u53ef\u89c4\u5b9a\u63a5\u53e3\u4e00\u90e8\u5206\u7684\u53d8\u91cf\u4e0e\u6052\u91cf\u5934\u91cc\u52a0\u4e0a\u201c\u6a21\u5757\u201d\u6807\u8bc6\u7b49\u3002 <\/p>\n
\u00bd\u4e09-\u4e09\uff1a\u7528\u51c6\u786e\u7684\u53cd\u4e49\u77ed\u8bed\u5b9a\u540d\u5177\u6709\u4e92\u65a5\u610f\u601d\u7684\u53d8\u91cf\u6216\u76f8\u53cd\u52a8\u4f5c\u7684\u51fd\u6570\u7b49\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u5e95\u4e0b\u662f\u4e00\u4e9b\u5728\u8f6f\u4ef6\u4e2d\u60ef\u7528\u7684\u53cd\u4e49\u77ed\u8bed\u3002 <\/p>\n
add \/ remove begin \/ end create \/ destroy <\/p>\n
insert \/ delete first \/ last get \/ release <\/p>\n
increment \/ decrement put \/ get <\/p>\n
add \/ delete lock \/ unlock open \/ close <\/p>\n
min \/ max old \/ new start \/ stop <\/p>\n
next \/ previous source \/ target show \/ hide <\/p>\n
send \/ receive source \/ destination <\/p>\n
cut \/ paste up \/ down <\/p>\n
\u793a\u8303\uff1a <\/p>\n
int min_sum; <\/p>\n
int max_sum; <\/p>\n
int add_user( BYTE *user_name ); <\/p>\n
int delete_user( BYTE *user_name ); <\/p>\n
\u00bd\u4e09-\u56db\uff1a\u9664\u5f00\u7f16\u8bd1\u5f00\u5173\/\u5934\u8d44\u6599\u7b49\u975e\u4e00\u822c\u65bd\u7528\uff0c\u5f53\u907f\u514d\u65bd\u7528_EXAMPLE_TEST_\u7b49\u7b49\u4ee5\u6b21\u5212\u7ebf\u5f00\u59cb\u548c\u626b\u5c3e\u7684\u5b9a\u4e49\u3002 <\/p>\n
\u56db \u53ef\u8bfb\u6027
\u00b9\u56db-\u4e00\uff1a\u6ce8\u610f\u6f14\u7b97\u7b26\u7684\u4f18\u5148\u7ea7\uff0c\u5e76\u7528\u62ec\u53f7\u660e\u786e\u8868\u8fbe\u5f0f\u7684\u64cd\u4f5c\u987a\u5e8f\uff0c\u907f\u514d\u65bd\u7528\u9ed8\u8bb8\u4f18\u5148\u7ea7\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u9632\u6b62\u9605\u8bfb\u7a0b\u5e8f\u65f6\u4ea7\u751f\u8bef\u89e3\uff0c\u9632\u6b62\u56e0\u9ed8\u8bb8\u7684\u4f18\u5148\u7ea7\u4e0e\u8bbe\u8ba1\u601d\u7ef4\u4e0d\u7b26\u800c\u4ee5\u81f4\u7a0b\u5e8f\u758f\u5931\u3002 <\/p>\n
\u793a\u8303\uff1a\u4e0b\u5217\u8bdd\u8bed\u4e2d\u7684\u8868\u8fbe\u5f0f <\/p>\n
word = (high << | low (\u4e00) <\/p>\n
if ((a | b) && (a & c)) (\u4e8c) <\/p>\n
if ((a | b) < (c & d)) (\u4e09) <\/p>\n
\u5982\u82e5\u4e66\u5199\u4e3a <\/p>\n
high << \u516b | low <\/p>\n
a | b && a & c <\/p>\n
a | b < c & d <\/p>\n
\u56e0\u4e3a <\/p>\n
high << \u516b | low = ( high << | low, <\/p>\n
a | b && a & c = (a | b) && (a & c)\uff0c <\/p>\n
(\u4e00)(\u4e8c)\u4e0d\u4f1a\u758f\u5931\uff0c\u4f46\u8bdd\u8bed\u4e0d\u6613\u61c2\u5f97\uff1b <\/p>\n
a | b < c & d = a | \uff08b < c\uff09 & d\uff0c(\u4e09)\u9020\u6210\u4e86\u5224\u65ad\u6761\u4ef6\u758f\u5931\u3002 <\/p>\n
\u00b9\u56db-\u4e8c\uff1a\u907f\u514d\u65bd\u7528\u4e0d\u6613\u4e86\u89e3\u7684\u6570\u76ee\u5b57\uff0c\u7528\u6545\u610f\u4e49\u7684\u6807\u8bc6\u6765\u4ee3\u66ff\u3002\u7275\u7cfb\u7269\u7406\u72b6\u6001\u6216\u8bb8\u5e26\u6709\u7269\u7406\u610f\u601d\u7684\u6052\u91cf\uff0c\u4e0d\u5e94\u76f4\u63a5\u8fd0\u7528\u6570\u76ee\u5b57\uff0c\u52a1\u987b\u7528\u6545\u610f\u4e49\u7684\u679a\u4e3e\u6216\u5b8f\u6765\u66ff\u4ee3\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u7684\u7a0b\u5e8f\u53ef\u8bfb\u6027\u5dee\u3002 <\/p>\n
if (Trunk[index].trunk_state == \u96f6) <\/p>\n
{ <\/p>\n
Trunk[index].trunk_state = \u4e00; <\/p>\n
... \/\/ program code <\/p>\n
} <\/p>\n
\u5f53\u6539\u6210\u5982\u6b21\u6a21\u5f0f\u3002 <\/p>\n
#define TRUNK_IDLE \u96f6 <\/p>\n
#define TRUNK_BUSY \u4e00 <\/p>\n
if (Trunk[index].trunk_state == TRUNK_IDLE) <\/p>\n
{ <\/p>\n
Trunk[index].trunk_state = TRUNK_BUSY; <\/p>\n
... \/\/ program code <\/p>\n
} <\/p>\n
\u00bd\u56db-\u4e00\uff1a\u6e90\u7a0b\u5e8f\u4e2d\u5173\u7cfb\u8f83\u4e3a\u677e\u5f1b\u7684\u4ee3\u7801\u5e94\u5c3d\u91cf\u90bb\u8fd1\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u6613\u4e8e\u7a0b\u5e8f\u7ffb\u9605\u548c\u67e5\u5bfb\u3002 <\/p>\n
\u793a\u8303\uff1a\u4ee5\u6b21\u4ee3\u7801\u683c\u5c40\u4e0d\u592a\u5408\u7406\u3002 <\/p>\n
rect.length = \u5341; <\/p>\n
char_poi = str; <\/p>\n
rect.width = \u4e94; <\/p>\n
\u82e5\u6309\u5982\u6b21\u65b9\u5f0f\u4e66\u5199\uff0c\u6216\u8bb8\u66f4\u660e\u6670\u4e00\u4e9b\u3002 <\/p>\n
rect.length = \u5341; <\/p>\n
rect.width = \u4e94; \/\/ \u77e9\u5f62\u7684\u957f\u4e0e\u9614\u5173\u7cfb\u8f83\u7d27\u5bc6\u4eb2\u5bc6\uff0c\u653e\u5728\u4e00\u8d77\u3002 <\/p>\n
char_poi = str; <\/p>\n
\u00bd\u56db-\u4e8c\uff1a\u4e0d\u7528\u8fd0\u7528\u96be\u61c2\u7684\u6280\u5de7\u6027\u5f88\u9ad8\u7684\u8bdd\u8bed\uff0c\u9664\u975e\u5f88\u6709\u5fc5\u8981\u65f6\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u9ad8\u6280\u80fd\u8bdd\u8bed\u4e0d\u7b49\u4e8e\u9ad8\u6548\u7684\u7a0b\u5e8f\uff0c\u5b9e\u8d28\u4e0a\u7a0b\u5e8f\u7684\u6548\u7387\u5173\u952e\u5728\u4e8e\u7b97\u6cd5\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u8868\u8fbe\u5f0f\uff0c\u8003\u8651\u4e0d\u5468\u5c31\u53ef\u80fd\u51fa\u6bdb\u75c5\uff0c\u4e5f\u8f83\u96be\u4e86\u89e3\u3002 <\/p>\n
* stat_poi ++ += \u4e00; <\/p>\n
* ++ stat_poi += \u4e00; <\/p>\n
\u5e94\u8bc0\u522b\u6539\u6210\u5982\u6b21\u3002 <\/p>\n
*stat_poi += \u4e00; <\/p>\n
stat_poi++; \/\/ \u6b642\u8bdd\u8bed\u6548\u80fd\u65e0\u5f02\u4e8e\u201c * stat_poi ++ += \u4e00; \u201d <\/p>\n
++ stat_poi; <\/p>\n
*stat_poi += \u4e00; \/\/ \u6b642\u8bdd\u8bed\u6548\u80fd\u65e0\u5f02\u4e8e\u201c * ++ stat_poi += \u4e00; \u201d <\/p>\n
\u4e94 \u53d8\u91cf\u3001\u6784\u9020
\u00b9\u4e94-\u4e00\uff1a\u53bb\u6389\u6ca1\u5fc5\u8981\u7684\u516c\u5171\u53d8\u91cf\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u516c\u5171\u53d8\u91cf\u662f\u589e\u5927\u6a21\u5757\u95f4\u8026\u5408\u7684\u7f18\u6545\u4e4b\u4e00\uff0c\u6545\u5e94\u51cf\u5c0f\u6ca1\u5fc5\u8981\u7684\u516c\u5171\u53d8\u91cf\u4ee5\u51cf\u4f4e\u6a21\u5757\u95f4\u7684\u8026\u5408\u5ea6\u3002 <\/p>\n
\u00b9\u4e94-\u4e8c\uff1a\u8ba4\u8ba4\u771f\u771f\u5b9a\u4e49\u5e76\u660e\u786e\u516c\u5171\u53d8\u91cf\u7684\u542b\u610f\u3001\u529f\u7528\u3001\u53d6\u503c\u8303\u7574\u53ca\u516c\u5171\u53d8\u91cf\u95f4\u7684\u5173\u7cfb\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u5728\u5bf9\u53d8\u91cf\u5ba3\u8a00\u7684\u4e0e\u6b64\u540c\u65f6\uff0c\u5e94\u5bf9\u5176\u542b\u610f\u3001\u529f\u7528\u53ca\u53d6\u503c\u8303\u7574\u5f00\u5c55\u8be0\u91ca\u8bf4\u660e\uff0c\u4e0e\u6b64\u540c\u65f6\u82e5\u6709\u5fc5\u8981\u8fd8\u5e94\u8bf4\u660e\u6bcb\u5b81\u5b83\u53d8\u91cf\u7684\u5173\u7cfb\u3002 <\/p>\n
\u00b9\u4e94-\u4e09\uff1a\u660e\u786e\u516c\u5171\u53d8\u91cf\u4e0e\u64cd\u4f5c\u6b64\u516c\u5171\u53d8\u91cf\u7684\u51fd\u6570\u6216\u5386\u7a0b\u7684\u5173\u7cfb\uff0c\u5982\u8bbf\u95ee\u3001\u6279\u6539\u53ca\u521b\u529e\u7b49\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u660e\u786e\u8fdb\u7a0b\u64cd\u4f5c\u53d8\u91cf\u7684\u5173\u7cfb\u540e\uff0c\u5c06\u6709\u76ca\u4e8e\u7a0b\u5e8f\u7684\u66f4\u8fdb\u4e00\u6b65\u4f18\u5316\u3001\u5355\u5143\u6d4b\u8bd5\u3001\u7cfb\u7edf\u8054\u8c03\u4ee5\u53ca\u4ee3\u7801\u7ef4\u62a4\u7b49\u3002\u8fd9\u79cd\u5173\u7cfb\u7684\u8bf4\u660e\u53ef\u5728\u8be0\u91ca\u6216\u6587\u6863\u4e2d\u63cf\u8ff0\u3002 <\/p>\n
\u793a\u8303\uff1a\u5728\u6e90\u6587\u4ef6\u4e2d\uff0c\u53ef\u6309\u5982\u6b21\u8be0\u91ca\u65b9\u5f0f\u8bf4\u660e\u3002 <\/p>\n
RELATION System_Init Input_Rec Print_Rec Stat_Score <\/p>\n
Student Create Modify Access Access <\/p>\n
Score Create Modify Access Access, Modify <\/p>\n
\u6ce8\uff1aRELATION\u4e3a\u64cd\u4f5c\u5173\u7cfb\uff1bSystem_Init\u3001Input_Rec\u3001Print_Rec\u3001Stat_Score\u4e3a\u56db\u4e2a\u4e0d\u540c\u7684\u51fd\u6570\uff1bStudent\u3001Score\u4e3a\u4e24\u4e2a\u5168\u5c40\u53d8\u91cf\uff1bCreate\u793a\u610f\u521b\u9020\uff0cModify\u793a\u610f\u6279\u6539\uff0cAccess\u793a\u610f\u8bbf\u95ee\u3002 <\/p>\n
\u6b64\u4e2d\uff0c\u51fd\u6570Input_Rec\u3001Stat_Score\u90fd\u53ef\u6279\u6539\u53d8\u91cfScore\uff0c\u6545\u800c\u53d8\u91cf\u5c06\u5524\u8d77\u51fd\u6570\u95f4\u8f83\u5927\u7684\u8026\u5408\uff0c\u5e76\u4e5f\u8bb8\u589e\u591a\u4ee3\u7801\u6d4b\u8bd5\u3001\u7ef4\u62a4\u7684\u96be\u5ea6\u3002 <\/p>\n
\u00b9\u4e94-\u56db\uff1a\u5e94\u5411\u516c\u5171\u53d8\u91cf\u4f20\u9001\u6570\u636e\u65f6\uff0c\u8981\u975e\u5e38\u5f53\u5fc3\uff0c\u9632\u6b62\u8d4b\u4e0e\u4e0d\u5408\u60c5\u7406\u7684\u503c\u6216\u8d8a\u5883\u7b49\u73b0\u8c61\u53d1\u4f5c\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u5bf9\u516c\u5171\u53d8\u91cf\u8d4b\u503c\u65f6\uff0c\u82e5\u6709\u5fc5\u8981\u5e94\u5f00\u5c55\u5408\u6cd5\u6027\u7a3d\u67e5\uff0c\u4ee5\u62d4\u9ad8\u4ee3\u7801\u7684\u53ef\u9760\u6027\u3001\u7a33\u5b9a\u6027\u3002 <\/p>\n
\u00b9\u4e94-\u4e94\uff1a\u9632\u6b62\u5c40\u90e8\u53d8\u91cf\u4e0e\u516c\u5171\u53d8\u91cf\u540c\u540d\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u82e5\u8fd0\u7528\u4e86\u8f83\u597d\u7684\u5b9a\u540d\u5b88\u5219\uff0c\u90a3\u4e48\u6b64\u95ee\u9898\u53ef\u81ea\u52a8\u5316\u9664\u3002 <\/p>\n
\u00b9\u4e94-\u516d\uff1a\u4e25\u7981\u5e94\u7528\u672a\u7ecf\u521d\u59cb\u5316\u7684\u53d8\u91cf\u4f5c\u4e3a\u53f3\u503c\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u7279\u522b\u662f\u5728C\/C++\u4e2d\u5f15\u8ff0\u672a\u7ecf\u8d4b\u503c\u7684\u6307\u9488\uff0c\u5e38\u5e38\u4f1a\u5f15\u8d77\u7cfb\u7edf\u5d29\u6e83\u3002 <\/p>\n
\u00bd\u4e94-\u4e00\uff1a\u7ed3\u6784\u4ec5\u6709\u4e00\u4e2a\u6a21\u5757\u6216\u51fd\u6570\u53ef\u4ee5\u6279\u6539\u3001\u521b\u8bbe\uff0c\u800c\u5176\u4ed6\u76f8\u5173\u6a21\u5757\u6216\u51fd\u6570\u53ea\u8bbf\u95ee\u7684\u516c\u5171\u53d8\u91cf\uff0c\u9632\u6b62\u591a\u4e2a\u4e0d\u540c\u6a21\u5757\u6216\u51fd\u6570\u90fd\u53ef\u4ee5\u6279\u6539\u3001\u521b\u9020\u540c\u4e00\u516c\u5171\u53d8\u91cf\u7684\u73b0\u8c61\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u51cf\u4f4e\u516c\u5171\u53d8\u91cf\u8026\u5408\u5ea6\u3002 <\/p>\n
\u00bd\u4e94-\u4e8c\uff1a\u65bd\u7528\u4e25\u5389\u6a21\u5f0f\u5b9a\u4e49\u7684\u3001\u53ef\u79fb\u683d\u7684\u6570\u636e\u95e8\u7c7b\uff0c\u5c3d\u53ef\u80fd\u4e0d\u7528\u65bd\u7528\u4e0e\u5177\u4f53\u786c\u4ef6\u6216\u8f6f\u4ef6\u73af\u5883\u5173\u7cfb\u5bc6\u5207\u7684\u53d8\u91cf\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u5e94\u7528\u57fa\u51c6\u7684\u6570\u636e\u90e8\u7c7b\uff0c\u6709\u76ca\u4e8e\u7a0b\u5e8f\u7684\u79fb\u683d\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u4f8b\u8bc1\uff08\u5728DOS\u505cBC3.1\u73af\u5883\u4e2d\uff09\uff0c\u5728\u79fb\u683d\u65f6\u4e5f\u8bb8\u53d1\u751f\u95ee\u9898\u3002 <\/p>\n
void main() <\/p>\n
{ <\/p>\n
register int index; \/\/ \u5bc4\u5b58\u5668\u53d8\u91cf <\/p>\n
_AX = \u96f6x4000; \/\/ _AX\u662fBC3.1\u63d0\u4f9b\u7684\u5bc4\u5b58\u5668\u201c\u4f2a\u53d8\u91cf\u201d <\/p>\n
... \/\/ program code <\/p>\n
} <\/p>\n
\u00bd\u4e94-\u4e09\uff1a\u6784\u9020\u7684\u6548\u80fd\u8981\u5355\u8c03\uff0c\u662f\u9488\u5bf9\u4e00\u79cd\u4e8b\u5b9c\u7684\u62bd\u8c61\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u8bbe\u8ba1\u6784\u9020\u65f6\u5e94\u529b\u4e89\u4f7f\u6784\u9020\u4ee3\u8868\u4e00\u79cd\u5b9e\u9645\u4e8b\u5b9c\u7684\u62bd\u8c61\uff0c\u800c\u4e0d\u662f\u540c\u65f6\u4ee3\u8868\u591a\u79cd\u3002\u6784\u9020\u4e2d\u7684\u5404\u5143\u7d20\u5e94\u4ee3\u8868\u540c\u4e00\u4e8b\u5b9c\u7684\u4e0d\u540c\u4fa7\u9762\uff0c\u800c\u4e0d\u5e94\u628a\u63cf\u8ff0\u6ca1\u6709\u5173\u7cfb\u6216\u5173\u7cfb\u5f88\u5f31\u7684\u4e0d\u540c\u4ec1\u52a1\u7684\u5143\u7d20\u653e\u5230\u540c\u4e00\u6784\u9020\u4e2d\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u6784\u9020\u4e0d\u592a\u660e\u6670\u3001\u5408\u7406\u3002 <\/p>\n
typedef struct STUDENT_STRU <\/p>\n
{ <\/p>\n
unsigned char name[\u516b]; \/* student's name *\/ <\/p>\n
unsigned char age; \/* student's age *\/ <\/p>\n
unsigned char sex; \/* student's sex, as follows *\/ <\/p>\n
\/* \u96f6 - FEMALE; \u4e00 - MALE *\/ <\/p>\n
unsigned char <\/p>\n
teacher_name[\u516b]; \/* the student teacher's name *\/ <\/p>\n
unisgned char <\/p>\n
teacher_sex; \/* his teacher sex *\/ <\/p>\n
} STUDENT; <\/p>\n
\u82e5\u6539\u6210\u5982\u6b21\uff0c\u6216\u8005\u66f4\u5408\u7406\u4e9b\u3002 <\/p>\n
typedef struct TEACHER_STRU <\/p>\n
{ <\/p>\n
unsigned char name[\u516b]; \/* teacher name *\/ <\/p>\n
unisgned char sex; \/* teacher sex, as follows *\/ <\/p>\n
\/* \u96f6 - FEMALE; \u4e00 - MALE *\/ <\/p>\n
} TEACHER; <\/p>\n
typedef struct STUDENT_STRU <\/p>\n
{ <\/p>\n
unsigned char name[\u516b]; \/* student's name *\/ <\/p>\n
unsigned char age; \/* student's age *\/ <\/p>\n
unsigned char sex; \/* student's sex, as follows *\/ <\/p>\n
\/* \u96f6 - FEMALE; \u4e00 - MALE *\/ <\/p>\n
unsigned int teacher_ind; \/* his teacher index *\/ <\/p>\n
} STUDENT; <\/p>\n
\u00bd\u4e94-\u56db\uff1a\u4e0d\u7528\u8bbe\u8ba1\u9762\u9762\u7686\u5230\u3001\u5341\u5206\u7075\u4fbf\u7684\u6570\u636e\u7ed3\u6784\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u9762\u9762\u7686\u5230\u3001\u7075\u4fbf\u7684\u6570\u636e\u7ed3\u6784\u53cd\u662f\u7b80\u5355\u5524\u8d77\u8bef\u4f1a\u548c\u64cd\u4f5c\u8270\u96be\u3002 <\/p>\n
\u00bd\u4e94-\u4e94\uff1a\u4e0d\u540c\u6784\u9020\u95f4\u7684\u5173\u7cfb\u4e0d\u7528\u8fc7\u4e8e\u590d\u6742\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u82e5\u4e24\u4e2a\u6784\u9020\u95f4\u5173\u7cfb\u8f83\u590d\u6742\u3001\u7d27\u5bc6\u4eb2\u5bc6\uff0c\u90a3\u4e48\u5e94\u5408\u4e3a\u4e00\u4e2a\u6784\u9020\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u4e24\u4e2a\u6784\u9020\u7684\u7ed3\u6784\u4e0d\u5408\u60c5\u7406\u3002 <\/p>\n
typedef struct PERSON_ONE_STRU <\/p>\n
{ <\/p>\n
unsigned char name[\u516b]; <\/p>\n
unsigned char addr[40]; <\/p>\n
unsigned char sex; <\/p>\n
unsigned char city[15]; <\/p>\n
} PERSON_ONE; <\/p>\n
typedef struct PERSON_TWO_STRU <\/p>\n
{ <\/p>\n
unsigned char name[\u516b]; <\/p>\n
unsigned char age; <\/p>\n
unsigned char tel; <\/p>\n
} PERSON_TWO; <\/p>\n
\u56e0\u4e3a\u4e24\u4e2a\u6784\u9020\u90fd\u662f\u63cf\u8ff0\u540c\u4e00\u4e8b\u7269\u7684\uff0c\u90a3\u4e48\u83ab\u82e5\u5408\u6210\u4e00\u4e2a\u6784\u9020\u3002 <\/p>\n
typedef struct PERSON_STRU <\/p>\n
{ <\/p>\n
unsigned char name[\u516b]; <\/p>\n
unsigned char age; <\/p>\n
unsigned char sex; <\/p>\n
unsigned char addr[40]; <\/p>\n
unsigned char city[15]; <\/p>\n
unsigned char tel; <\/p>\n
} PERSON; <\/p>\n
\u00bd\u4e94-\u516d\uff1a\u6784\u9020\u4e2d\u5143\u7d20\u7684\u4e2a\u6570\u5e94\u9002\u4e2d\u3002\u82e5\u6784\u9020\u4e2d\u5143\u7d20\u4e2a\u6570\u8fc7\u5269\u53ef\u601d\u8003\u6839\u636e\u67d0\u79cd\u51c6\u5219\u628a\u5143\u7d20\u7ed3\u6210\u4e0d\u540c\u7684\u5b50\u6784\u9020\uff0c\u4ee5\u51cf\u5c0f\u539f\u6784\u9020\u4e2d\u5143\u7d20\u7684\u4e2a\u6570\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u589e\u591a\u6784\u9020\u7684\u53ef\u7406\u89e3\u6027\u3001\u64cd\u4f5c\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002 <\/p>\n
\u793a\u8303\uff1a\u5047\u82e5\u4ee5\u4e3a\u4e0a\u8ff0\u7684_PERSON\u6784\u9020\u5143\u7d20\u8fc7\u5269\uff0c\u90a3\u4e48\u53ef\u5982\u6b21\u5bf9\u4e4b\u533a\u5212\u3002 <\/p>\n
typedef struct PERSON_BASE_INFO_STRU <\/p>\n
{ <\/p>\n
unsigned char name[\u516b]; <\/p>\n
unsigned char age; <\/p>\n
unsigned char sex; <\/p>\n
} PERSON_BASE_INFO; <\/p>\n
typedef struct PERSON_ADDRESS_STRU <\/p>\n
{ <\/p>\n
unsigned char addr[40]; <\/p>\n
unsigned char city[15]; <\/p>\n
unsigned char tel; <\/p>\n
} PERSON_ADDRESS; <\/p>\n
typedef struct PERSON_STRU <\/p>\n
{ <\/p>\n
PERSON_BASE_INFO person_base; <\/p>\n
PERSON_ADDRESS person_addr; <\/p>\n
} PERSON; <\/p>\n
\u00bd\u4e94-\u4e03\uff1a\u4ed4\u4ed4\u7ec6\u7ec6\u8bbe\u8ba1\u6784\u9020\u4e2d\u5143\u7d20\u7684\u683c\u5c40\u4e0e\u6392\u5217\u987a\u5e8f\uff0c\u4f7f\u6784\u9020\u7b80\u5355\u4e86\u89e3\u3001\u4fed\u7701\u5360\u7528\u7a7a\u95f4\uff0c\u5e76\u51cf\u5c0f\u5524\u8d77\u8bef\u7528\u73b0\u8c61\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u5408\u7406\u6392\u5217\u6784\u9020\u4e2d\u5143\u7d20\u987a\u5e8f\uff0c\u53ef\u4fed\u7701\u7a7a\u95f4\u5e76\u589e\u591a\u53ef\u7406\u89e3\u6027\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u6784\u9020\u4e2d\u7684\u4f4d\u57df\u6392\u5217\uff0c\u5c06\u5360\u8f83\u5927\u7a7a\u95f4\uff0c\u53ef\u8bfb\u6027\u4e5f\u7a0d\u5dee\u3002 <\/p>\n
typedef struct EXAMPLE_STRU <\/p>\n
{ <\/p>\n
unsigned int valid: \u4e00; <\/p>\n
PERSON person; <\/p>\n
unsigned int set_flg: \u4e00; <\/p>\n
} EXAMPLE; <\/p>\n
\u82e5\u6539\u4e3a\u5982\u6b21\u65b9\u5f0f\uff0c\u4e0d\u5149\u53ef\u4fed\u77011\u5b57\u8282\u7a7a\u95f4\uff0c\u53ef\u8bfb\u6027\u4e5f\u53d8\u597d\u4e86\u3002 <\/p>\n
typedef struct EXAMPLE_STRU <\/p>\n
{ <\/p>\n
unsigned int valid: \u4e00; <\/p>\n
unsigned int set_flg: \u4e00; <\/p>\n
PERSON person ; <\/p>\n
} EXAMPLE; <\/p>\n
\u00bd\u4e94-\u516b\uff1a\u6784\u9020\u7684\u8bbe\u8ba1\u8981\u5c3d\u53ef\u80fd\u601d\u8003\u5411\u524d\u517c\u5bb9\u548c\u4e4b\u540e\u7684\u7248\u672c\u5347\u683c\uff0c\u5e76\u4e3a\u67d0\u4e9b\u5c06\u6765\u4e5f\u8bb8\u7684\u8fd0\u7528\u4fdd\u7559\u4f59\u5730\uff08\u5982\u9884\u7559\u4e00\u4e9b\u7a7a\u95f4\u7b49\uff09\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u8f6f\u4ef6\u5411\u524d\u517c\u5bb9\u7684\u7279\u70b9\uff0c\u662f\u8f6f\u4ef6\u4ea7\u54c1\u662f\u4e0d\u662f\u987a\u5229\u7684\u4e3b\u8981\u6807\u793a\u4e4b\u4e00\u3002\u5982\u82e5\u8981\u60f3\u4f7f\u4ea7\u54c1\u5177\u6709\u8f83\u597d\u7684\u524d\u5411\u517c\u5bb9\uff0c\u90a3\u4e48\u5728\u4ea7\u54c1\u8bbe\u8ba1\u4e4b\u521d\u5c31\u5e94\u4e3a\u4e4b\u540e\u7248\u672c\u5347\u683c\u4fdd\u5b58\u4e00\u5b9a\u540e\u8def\uff0c\u5e76\u4e14\u5728\u4ea7\u54c1\u5347\u7ea7\u65f6\u52a1\u5fc5\u601d\u8003\u524d\u4e00\u7248\u672c\u7684\u5404\u79cd\u7279\u70b9\u3002 <\/p>\n
\u00bd\u4e94-\u4e5d\uff1a\u7559\u610f\u5177\u4f53\u8bed\u8a00\u53ca\u7f16\u8bd1\u5668\u5904\u7f6e\u4e0d\u540c\u6570\u636e\u95e8\u7c7b\u7684\u51c6\u5219\u53ca\u76f8\u5173\u7ec6\u8282\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u5982\u5728C\u8bed\u8a00\u4e2d\uff0cstatic\u5c40\u90e8\u53d8\u91cf\u5c06\u5728\u5185\u5b58\u50a8\u5668\u201c\u6570\u636e\u533a\u201d\u4e2d\u751f\u6210\uff0c\u800c\u975estatic\u5c40\u90e8\u53d8\u91cf\u5c06\u5728\u201c\u5806\u6808\u201d\u4e2d\u751f\u6210\u3002\u8fd9\u4e9b\u7ec6\u8282\u5bf9\u7a0b\u5e8f\u54c1\u8d28\u7684\u4fdd\u8bc1\u4e66\u975e\u5e38\u91cd\u8981\u3002 <\/p>\n
\u00bd\u4e94-\u5341\uff1a\u7f16\u7a0b\u65f6\uff0c\u8981\u6ce8\u610f\u6570\u636e\u95e8\u7c7b\u7684\u631f\u5236\u53d8\u6362\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u5e94\u8fdb\u5c55\u6570\u636e\u95e8\u7c7b\u631f\u5236\u53d8\u6362\u65f6\uff0c\u5176\u6570\u636e\u7684\u610f\u601d\u3001\u53d8\u6362\u540e\u7684\u53d6\u503c\u7b49\u90fd\u6709\u53ef\u80fd\u53d1\u751f\u53d8\u5316\uff0c\u800c\u8fd9\u4e9b\u7ec6\u8282\u82e5\u8003\u8651\u4e0d\u5468\uff0c\u5c31\u5f88\u6709\u4e5f\u8bb8\u7559\u4e0b\u9690\u60a3\u3002 <\/p>\n
\u00bd\u4e94-11\uff1a\u5bf9\u7f16\u8bd1\u7cfb\u7edf\u9ed8\u8bb8\u7684\u6570\u636e\u95e8\u7c7b\u53d8\u6362\uff0c\u4e5f\u8981\u6709\u5145\u5206\u7684\u8ba4\u8bc6\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u8d4b\u503c\uff0c\u534a\u6570\u4ee5\u4e0a\u7f16\u8bd1\u5668\u4e0d\u53d1\u4f5c\u544a\u8b66\uff0c\u4f46\u503c\u7684\u542b\u610f\u4ecd\u662f\u7a0d\u6709\u53d8\u66f4\u3002 <\/p>\n
char chr; <\/p>\n
unsigned short int exam; <\/p>\n
chr = -\u4e00; <\/p>\n
exam = chr; \/\/ \u7f16\u8bd1\u5668\u4e0d\u53d1\u4f5c\u544a\u8b66\uff0c\u6b64\u65f6\u6b64\u523bexam\u4e3a\u96f6xFFFF\u3002 <\/p>\n
\u00bd\u4e94-12\uff1a\u5c3d\u53ef\u80fd\u51cf\u5c0f\u6ca1\u6709\u5fc5\u8981\u7684\u6570\u636e\u90e8\u7c7b\u9ed8\u8bb8\u53d8\u6362\u4e0e\u631f\u5236\u53d8\u6362\u3002 <\/p>\n
\u00bd\u4e94-13\uff1a\u5408\u7406\u5730\u8bbe\u8ba1\u6570\u636e\u5e76\u5e94\u7528\u81ea\u5b9a\u4e49\u6570\u636e\u95e8\u7c7b\uff0c\u907f\u514d\u6570\u636e\u95f4\u5f00\u5c55\u7528\u4e0d\u7740\u7684\u95e8\u7c7b\u53d8\u6362\u3002 <\/p>\n
\u00bd\u4e94-14\uff1a\u5bf9\u81ea\u5b9a\u4e49\u6570\u636e\u90e8\u7c7b\u5f00\u5c55\u6070\u5f53\u5b9a\u540d\uff0c\u4f7f\u5b83\u53d8\u6210\u81ea\u63cf\u8ff0\u6027\u7684\uff0c\u4ee5\u62d4\u9ad8\u4ee3\u7801\u53ef\u8bfb\u6027\u3002\u6ce8\u610f\u5176\u5b9a\u540d\u6a21\u5f0f\u5728\u540c\u4e00\u4ea7\u54c1\u4e2d\u7684\u4e00\u81f4\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u5e94\u7528\u81ea\u5b9a\u4e49\u95e8\u7c7b\uff0c\u53ef\u4ee5\u8865\u6551\u7f16\u7a0b\u8bed\u8a00\u63d0\u4f9b\u90e8\u7c7b\u5c11\u3001\u4fe1\u606f\u91cf\u4e0d\u8db3\u7684\u7f3a\u70b9\uff0c\u5e76\u80fd\u4f7f\u7a0b\u5e8f\u660e\u6670\u3001\u7b80\u660e\u3002 <\/p>\n
\u793a\u8303\uff1a\u53ef\u53c2\u7167\u5982\u6b21\u6a21\u5f0f\u5ba3\u8a00\u81ea\u5b9a\u4e49\u6570\u636e\u90e8\u7c7b\u3002 <\/p>\n
\u4e0b\u90e8\u7684\u5ba3\u8a00\u53ef\u4f7f\u6570\u636e\u95e8\u7c7b\u7684\u65bd\u7528\u7b80\u660e\u3001\u4e86\u7136\u3002 <\/p>\n
typedef unsigned char BYTE; <\/p>\n
typedef unsigned short WORD; <\/p>\n
typedef unsigned int DWORD; <\/p>\n
\u5e95\u4e0b\u7684\u5ba3\u8a00\u53ef\u4f7f\u6570\u636e\u90e8\u7c7b\u5177\u6709\u66f4\u4e30\u5bcc\u7684\u542b\u610f\u3002 <\/p>\n
typedef float DISTANCE; <\/p>\n
typedef float SCORE; <\/p>\n
\u00bd\u4e94-15\uff1a\u5e94\u5ba3\u8a00\u7528\u4ee5\u5206\u5e03\u5f0f\u73af\u5883\u6216\u4e0d\u540cCPU\u95f4\u901a\u8baf\u73af\u5883\u7684\u6570\u636e\u7ed3\u6784\u65f6\uff0c\u52a1\u987b\u601d\u5fd6\u673a\u5668\u7684\u5b57\u8282\u987a\u5e8f\u3001\u65bd\u7528\u7684\u4f4d\u57df\u53ca\u5b57\u8282\u5bf9\u9f50\u7b49\u95ee\u9898 \u3002 <\/p>\n
\u8bf4\u660e\uff1a\u4f8b\u5982Intel CPU\u4e0e68360 CPU\uff0c\u5728\u5904\u7f6e\u4f4d\u57df\u53ca\u6574\u6570\u65f6\uff0c\u5176\u5728\u5185\u5b58\u50a8\u5668\u5bc4\u5b58\u7684\u201c\u987a\u5e8f\u201d\u6070\u597d\u76f8\u53cd\u3002 <\/p>\n
\u793a\u8303\uff1a\u5047\u5982\u5982\u540c\u4e0b\u77ed\u6574\u6570\u53ca\u6784\u9020\u3002 <\/p>\n
unsigned short int exam; <\/p>\n
typedef struct EXAM_BIT_STRU <\/p>\n
{ \/* Intel 68360 *\/ <\/p>\n
unsigned int A\u4e00: \u4e00; \/* bit \u96f6 \u4e03 *\/ <\/p>\n
unsigned int A\u4e8c: \u4e00; \/* bit \u4e00 \u516d *\/ <\/p>\n
unsigned int A\u4e09: \u4e00; \/* bit \u4e8c \u4e94 *\/ <\/p>\n
} EXAM_BIT; <\/p>\n
\u5982\u6b21\u662fIntel CPU\u751f\u6210\u77ed\u6574\u6570\u53ca\u4f4d\u57df\u7684\u6a21\u5f0f\u3002 <\/p>\n
\u5185\u5b58\u50a8\u5668\uff1a \u96f6 \u4e00 \u4e8c ... \uff08\u4ece\u4f4e\u5230\u9ad8\uff0c\u4ee5\u5b57\u8282\u4e3a\u673a\u5173\uff09 <\/p>\n
exam exam\u4f4e\u5b57\u8282 exam\u9ad8\u5b57\u8282 <\/p>\n
\u5185\u5b58\u50a8\u5668\uff1a \u96f6 bit \u4e00 bit \u4e8c bit ... \uff08\u5b57\u8282\u7684\u5404\u201c\u4f4d\u201d\uff09 <\/p>\n
EXAM_BIT A\u4e00 A\u4e8c A\u4e09 <\/p>\n
\u5982\u6b21\u662f68360 CPU\u751f\u6210\u77ed\u6574\u6570\u53ca\u4f4d\u57df\u7684\u5f62\u5f0f\u3002 <\/p>\n
\u5185\u5b58\u50a8\u5668\uff1a \u96f6 \u4e00 \u4e8c ... \uff08\u4ece\u4f4e\u5230\u9ad8\uff0c\u4ee5\u5b57\u8282\u4e3a\u673a\u6784\uff09 <\/p>\n
exam exam\u9ad8\u5b57\u8282 exam\u4f4e\u5b57\u8282 <\/p>\n
\u5185\u5b58\u50a8\u5668\uff1a \u4e03 bit \u516d bit \u4e94 bit ... \uff08\u5b57\u8282\u7684\u5404\u201c\u4f4d\u201d\uff09 <\/p>\n
EXAM_BIT A\u4e00 A\u4e8c A\u4e09 <\/p>\n
\u8bf4\u660e\uff1a\u5728\u5bf9\u9f50\u5f62\u5f0f\u505c\uff0cCPU\u7684\u8fd0\u4f5c\u6548\u7387\u8981\u5feb\u5f97\u591a\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u56fe\uff0c\u5e94\u4e00\u4e2along\u578b\u6570\uff08\u5982\u56fe\u4e2dlong\u4e00\uff09\u5728\u5185\u5b58\u50a8\u5668\u4e2d\u7684\u4f4d\u7f6e\u6070\u597d\u4e0e\u5185\u5b58\u50a8\u5668\u7684\u5b57\u5730\u754c\u5bf9\u9f50\u65f6\uff0cCPU\u5b58\u53d6\u8fd9\u4e2a\u6570\u53ea\u9700\u8bbf\u95ee\u4e00\u6b21\u5185\u5b58\u50a8\u5668\uff0c\u800c\u5f53\u4e00\u4e2along\u578b\u6570\uff08\u5982\u56fe\u4e2d\u7684long\u4e8c\uff09\u5728\u5185\u5b58\u50a8\u5668\u4e2d\u7684\u4f4d\u7f6e\u8d85\u8d8a\u4e86\u5b57\u8fb9\u5883\u65f6\uff0cCPU\u5b58\u53d6\u8fd9\u4e2a\u6570\u5c31\u9700\u8981\u7d2f\u6b21\u8bbf\u95ee\u5185\u5b58\u50a8\u5668\uff0c\u5982i960cx\u8bbf\u95ee\u8fd9\u4e48\u7684\u6570\u9700\u8bfb\u5185\u5b58\u50a8\u5668\u4e09\u6b21\uff08\u4e00\u4e2aBYTE\u3001\u4e00\u4e2aSHORT\u3001\u4e00\u4e2aBYTE\uff0c\u7531CPU\u7684\u5fae\u4ee3\u7801\u5b9e\u65bd\uff0c\u5bf9\u8f6f\u4ef6\u900f\u660e\uff09\uff0c\u5168\u90e8\u5bf9\u9f50\u5f62\u5f0f\u505cCPU\u7684\u8fd0\u4f5c\u6548\u7387\u663e\u7136\u5feb\u591a\u4e86\u3002 <\/p>\n
\u4e00 \u516b 16 24 32 <\/p>\n
------- ------- ------- ------- <\/p>\n
| long\u4e00 | long\u4e00 | long\u4e00 | long\u4e00 | <\/p>\n
------- ------- ------- ------- <\/p>\n
| | | | long\u4e8c | <\/p>\n
------- ------- ------- -------- <\/p>\n
| long\u4e8c | long\u4e8c | long\u4e8c | | <\/p>\n
------- ------- ------- -------- <\/p>\n
| .... <\/p>\n
\u516d \u51fd\u6570\u3001\u8fdb\u7a0b
\u00b9\u516d-\u4e00\uff1a\u5bf9\u6240\u8c03\u7528\u51fd\u6570\u7684\u5dee\u9519\u56de\u6765\u7801\u8981\u4ed4\u4ed4\u7ec6\u7ec6\u3001\u5168\u9762\u5730\u5904\u7f6e\u3002 <\/p>\n
\u00b9\u516d-\u4e8c\uff1a\u660e\u786e\u51fd\u6570\u6548\u80fd\uff0c\u7cbe\u786e\uff08\u800c\u4e0d\u662f\u5c06\u8fd1\uff09\u5730\u5151\u73b0\u51fd\u6570\u8bbe\u8ba1\u3002 <\/p>\n
\u00b9\u516d-\u4e09\uff1a\u7f16\u64b0\u53ef\u91cd\u5165\u51fd\u6570\u65f6\uff0c\u5f53\u6ce8\u610f\u5c40\u90e8\u53d8\u91cf\u7684\u65bd\u7528\uff08\u5982\u7f16\u7e82C\/C++\u8bed\u8a00\u7684\u53ef\u91cd\u5165\u51fd\u6570\u65f6\uff0c\u5f53\u5e94\u7528auto\u5373\u7f3a\u7701\u6001\u5c40\u90e8\u53d8\u91cf\u6216\u5bc4\u5b58\u5668\u53d8\u91cf\uff09\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u7f16\u7e82C\/C++\u8bed\u8a00\u7684\u53ef\u91cd\u5165\u51fd\u6570\u65f6\uff0c\u4e0d\u5e94\u65bd\u7528static\u5c40\u90e8\u53d8\u91cf\uff0c\u4e0d\u7136\u52a1\u5fc5\u900f\u8fc7\u975e\u4e00\u822c\u5904\u7f6e\uff0c\u624d\u529b\u4f7f\u51fd\u6570\u5177\u6709\u53ef\u91cd\u5165\u6027\u3002 <\/p>\n
\u00b9\u516d-\u56db\uff1a\u7f16\u7e82\u53ef\u91cd\u5165\u51fd\u6570\u65f6\uff0c\u82e5\u5e94\u7528\u5168\u5c40\u53d8\u91cf\uff0c\u5219\u5e94\u900f\u8fc7\u5173\u4e2d\u6b62\u3001\u4fe1\u53f7\u91cf\uff08\u5373P\u3001V\u64cd\u4f5c\uff09\u7b49\u624b\u6bb5\u5bf9\u5176\u52a0\u4ee5\u4fdd\u62a4\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u82e5\u5bf9\u6240\u5e94\u7528\u7684\u5168\u5c40\u53d8\u91cf\u4e0d\u52a0\u4ee5\u4fdd\u62a4\uff0c\u5219\u6b64\u51fd\u6570\u5c31\u4e0d\u5177\u6709\u53ef\u91cd\u5165\u6027\uff0c\u5373\u5f53\u591a\u4e2a\u5386\u7a0b\u8c03\u7528\u6b64\u51fd\u6570\u65f6\uff0c\u5f88\u6709\u6216\u8005\u4f7f\u76f8\u5173\u5168\u5c40\u53d8\u91cf\u53d8\u6210\u4e0d\u53ef\u77e5\u72b6\u6001\u3002 <\/p>\n
\u793a\u8303\uff1a\u5047\u60f3Exam\u662fint\u578b\u5168\u5c40\u53d8\u91cf\uff0c\u51fd\u6570Squre_Exam\u56de\u5230Exam\u5e73\u65b9\u503c\u3002\u90a3\u4e48\u5982\u6b21\u51fd\u6570\u4e0d\u5177\u6709\u53ef\u91cd\u5165\u6027\u3002 <\/p>\n
unsigned int example( int para ) <\/p>\n
{ <\/p>\n
unsigned int temp; <\/p>\n
Exam = para; \/\/ \uff08**\uff09 <\/p>\n
temp = Square_Exam( ); <\/p>\n
return temp; <\/p>\n
} <\/p>\n
\u6b64\u51fd\u6570\u82e5\u88ab\u591a\u4e2a\u5386\u7a0b\u8c03\u7528\u7684\u8bdd\uff0c\u5176\u7ed3\u679c\u53ef\u80fd\u662f\u672a\u77e5\u7684\uff0c\u7531\u4e8e\u5e94\uff08**\uff09\u8bdd\u8bed\u521a\u65bd\u884c\u5b8c\u540e\uff0c\u9664\u6b64\u800c\u5916\u4e00\u4e2a\u8fd0\u7528\u672c\u51fd\u6570\u7684\u5386\u7a0b\u4e5f\u8bb8\u6070\u597d\u88ab\u6fc0\u6d3b\uff0c\u90a3\u4e48\u5f53\u65b0\u6fc0\u6d3b\u7684\u5386\u7a0b\u5b9e\u65bd\u5230\u6b64\u51fd\u6570\u65f6\uff0c\u5c06\u4f7fExam\u8d4b\u4e0e\u53e6\u4e00\u4e2a\u4e0d\u540c\u7684para\u503c\uff0c\u4e4b\u6240\u4ee5\u5f53\u7edf\u5236\u4ece\u65b0\u8fd4\u56de\u201ctemp = Square_Exam( )\u201d\u540e\uff0c\u8ba1\u7b97\u51fa\u7684temp\u5f88\u53ef\u80fd\u4e0d\u662f\u6599\u60f3\u4e2d\u7684\u7ed3\u679c\u3002\u6b64\u51fd\u6570\u5e94\u5982\u6b21\u6539\u5584\u3002 <\/p>\n
unsigned int example( int para ) <\/p>\n
{ <\/p>\n
unsigned int temp; <\/p>\n
[\u7533\u8bf7\u4fe1\u53f7\u91cf\u64cd\u4f5c] \/\/ \u82e5\u7533\u8bf7\u4e0d\u5230\u201c\u4fe1\u53f7\u91cf\u201d\uff0c\u8bf4\u660e\u9664\u6b64\u4ee5\u5916\u7684\u8fc7\u7a0b\u6b63\u5904\u4e8e <\/p>\n
Exam = para; \/\/ \u7ed9Exam\u8d4b\u503c\u5e76\u8ba1\u7b97\u5176\u5e73\u65b9\u8fc7\u7a0b\u4e2d\uff08\u5373\u5728\u8fd0\u7528\u6b64 <\/p>\n
temp = Square_Exam( ); \/\/ \u4fe1\u53f7\uff09\uff0c\u672c\u5386\u7a0b\u52a1\u5fc5\u7b49\u5019\u5176\u5f00\u91ca\u4fe1\u53f7\u540e\uff0c\u624d\u53ef\u7ee7 <\/p>\n
[\u5f00\u91ca\u4fe1\u53f7\u91cf\u64cd\u4f5c] \/\/ \u7eed\u5b9e\u65bd\u3002\u82e5\u7533\u8bf7\u5230\u4fe1\u53f7\uff0c\u5219\u53ef\u6301\u7eed\u5b9e\u65bd\uff0c\u4f46\u5176 <\/p>\n
\/\/ \u5b83\u5386\u7a0b\u52a1\u987b\u7b49\u5019\u672c\u8fc7\u7a0b\u5f00\u91ca\u4fe1\u53f7\u91cf\u540e\uff0c\u624d\u8bc6\u518d\u4f7f <\/p>\n
\/\/ \u7528\u672c\u4fe1\u53f7\u3002 <\/p>\n
return temp; <\/p>\n
} <\/p>\n
\u00b9\u516d-\u4e94\uff1a\u5728\u540c\u4e00\u9879\u76ee\u7ec4\u5e94\u660e\u786e\u89c4\u5b9a\u63a5\u5408\u53e3\u51fd\u6570\u53c2\u6570\u7684\u5408\u6cd5\u6027\u68c0\u5bdf\u5e94\u7531\u51fd\u6570\u7684\u8c03\u7528\u8005\u8d1f\u8d23\u4ecd\u662f\u7531\u63a5\u53e3\u51fd\u6570\u81ea\u8eab\u8d1f\u8d23\uff0c\u7f3a\u7701\u662f\u7531\u51fd\u6570\u8c03\u7528\u8005\u8d1f\u8d23\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u5173\u4e8e\u6a21\u5757\u95f4\u63a5\u53e3\u51fd\u6570\u7684\u53c2\u6570\u7684\u5408\u6cd5\u6027\u68c0\u5bdf\u8fd9\u4e00\u95ee\u9898\uff0c\u5f80\u5f80\u6709\u4e24\u4e2a\u6781\u7aef\u73b0\u8c61\uff0c\u5373\uff1a\u8981\u4e0d\u662f\u8c03\u7528\u8005\u548c\u88ab\u8c03\u7528\u8005\u5bf9\u53c2\u6570\u5747\u4e0d\u4f5c\u5408\u6cd5\u6027\u7a3d\u67e5\uff0c\u7ed3\u679c\u5c31\u758f\u6f0f\u4e86\u5408\u6cd5\u6027\u7a3d\u67e5\u8fd9\u4e00\u5fc5\u8981\u7684\u5904\u7f6e\u8fdb\u7a0b\uff0c\u4fc3\u6210\u95ee\u9898\u9690\u60a3\uff1b\u8981\u4e0d\u4e43\u662f\u8c03\u7528\u8005\u548c\u88ab\u8c03\u7528\u8005\u5747\u5bf9\u53c2\u6570\u8fdb\u5c55\u5408\u6cd5\u6027\u68c0\u5bdf\uff0c\u8fd9\u79cd\u666f\u51b5\u867d\u4e0d\u4f1a\u4fc3\u6210\u95ee\u9898\uff0c\u4f46\u53d1\u751f\u4e86\u5197\u4f59\u4ee3\u7801\uff0c\u51cf\u4f4e\u4e86\u6548\u7387\u3002 <\/p>\n
\u00bd\u516d-\u4e00\uff1a\u9632\u6b62\u5c06\u51fd\u6570\u7684\u53c2\u6570\u4f5c\u4e3a\u5de5\u4f5c\u53d8\u91cf\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u5c06\u51fd\u6570\u7684\u53c2\u6570\u4f5c\u4e3a\u5de5\u4f5c\u53d8\u91cf\uff0c\u6709\u6216\u8005\u5dee\u9519\u5730\u6539\u53d8\u53c2\u6570\u5185\u5bb9\uff0c\u4e4b\u6240\u4ee5\u5f88\u98ce\u9669\u3002\u5bf9\u52a1\u987b\u6539\u53d8\u7684\u53c2\u6570\uff0c\u6700\u597d\u5148\u7528\u5c40\u90e8\u53d8\u91cf\u4ee3\u4e4b\uff0c\u6700\u540e\u518d\u5c06\u8be5\u5c40\u90e8\u53d8\u91cf\u7684\u5185\u5bb9\u8d4b\u7ed9\u8be5\u53c2\u6570\u3002 <\/p>\n
\u793a\u8303\uff1a\u505c\u51fd\u6570\u7684\u5151\u73b0\u4e0d\u592a\u597d\u3002 <\/p>\n
void sum_data( unsigned int num, int *data, int *sum ) <\/p>\n
{ <\/p>\n
unsigned int count; <\/p>\n
*sum = \u96f6; <\/p>\n
for (count = \u96f6; count < num; count++) <\/p>\n
{ <\/p>\n
*sum += data[count]; \/\/ sum\u6210\u4e86\u5de5\u4f5c\u53d8\u91cf\uff0c\u4e0d\u592a\u597d\u3002 <\/p>\n
} <\/p>\n
} <\/p>\n
\u82e5\u6539\u6210\u5982\u6b21\uff0c\u5219\u66f4\u597d\u4e9b\u3002 <\/p>\n
void sum_data( unsigned int num, int *data, int *sum ) <\/p>\n
{ <\/p>\n
unsigned int count ; <\/p>\n
int sum_temp; <\/p>\n
sum_temp = \u96f6; <\/p>\n
for (count = \u96f6; count < num; count ++) <\/p>\n
{ <\/p>\n
sum_temp += data[count]; <\/p>\n
} <\/p>\n
*sum = sum_temp; <\/p>\n
} <\/p>\n
\u00bd\u516d-\u4e8c\uff1a\u51fd\u6570\u7684\u89c4\u6a21\u5c3d\u53ef\u80fd\u9650\u5236\u5728200\u884c\u4e4b\u5185\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u4e0d\u5305\u62ec\u8be0\u91ca\u548c\u7a7a\u683c\u884c\u3002 <\/p>\n
\u00bd\u516d-\u4e09\uff1a\u4e00\u4e2a\u51fd\u6570\u4ec5\u5b8c\u6210\u4e00\u4ef6\u6548\u80fd\u3002 <\/p>\n
\u00bd\u516d-\u56db\uff1a\u4e3a\u5bb9\u6613\u6548\u80fd\u7f16\u7e82\u51fd\u6570\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u5c3d\u7ba1\u4e3a\u4ec5\u7528\u4e00\u4e24\u884c\u5c31\u53ef\u5b8c\u6210\u7684\u6548\u80fd\u53bb\u7f16\u51fd\u6570\u597d\u8c61\u6ca1\u6709\u5fc5\u8981\uff0c\u4f46\u7528\u51fd\u6570\u53ef\u4f7f\u6548\u80fd\u660e\u786e\u5316\uff0c\u589e\u591a\u7a0b\u5e8f\u53ef\u8bfb\u6027\uff0c\u4ea6\u53ef\u4fbf\u5229\u7ef4\u62a4\u3001\u6d4b\u8bd5\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u8bdd\u8bed\u7684\u6548\u80fd\u4e0d\u5f88\u660e\u663e\u3002 <\/p>\n
value = ( a > b ) ? a : b ; <\/p>\n
\u6539\u6210\u5982\u6b21\u5c31\u5f88\u660e\u6670\u4e86\u3002 <\/p>\n
int max (int a, int b) <\/p>\n
{ <\/p>\n
return ((a > b) ? a : b); <\/p>\n
} <\/p>\n
value = max (a, b); <\/p>\n
\u6216\u6539\u6210\u5982\u6b21\u3002 <\/p>\n
#define MAX (a, b) (((a) > (b)) ? (a) : (b)) <\/p>\n
value = MAX (a, b); <\/p>\n
\u00bd\u516d-\u4e94\uff1a\u4e0d\u7528\u8bbe\u8ba1\u591a\u7528\u9014\u9762\u9762\u7686\u5230\u7684\u51fd\u6570\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u591a\u529f\u80fd\u96c6\u4e8e\u4e00\u8eab\u7684\u51fd\u6570\uff0c\u5f88\u53ef\u80fd\u4f7f\u51fd\u6570\u7684\u61c2\u5f97\u3001\u6d4b\u8bd5\u3001\u7ef4\u62a4\u7b49\u53d8\u5f97\u8270\u96be\u3002 <\/p>\n
\u00bd\u516d-\u516d\uff1a\u51fd\u6570\u7684\u6548\u80fd\u5e94\u8be5\u662f\u53ef\u4ee5\u9884\u6d4b\u7684\uff0c\u4e5f\u4e43\u662f\u53ea\u8981\u8f93\u5165\u6570\u636e\u96f7\u540c\u5c31\u5e94\u53d1\u4f5c\u4e00\u6837\u7684\u8f93\u51fa\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u542b\u6709\u5185\u90e8\u201c\u5b58\u50a8\u5668\u201d\u7684\u51fd\u6570\u7684\u6548\u80fd\u53ef\u80fd\u662f\u4e0d\u53ef\u9884\u6d4b\u7684\uff0c\u7531\u4e8e\u5b83\u7684\u8f93\u51fa\u4e5f\u8bb8\u53d6\u51b3\u5185\u90e8\u5b58\u50a8\u5668\uff08\u5982\u67d0\u6807\u8bb0\uff09\u7684\u72b6\u6001\u3002\u8fd9\u4e48\u7684\u51fd\u6570\u65e2\u4e0d\u4fbf\u4e8e\u61c2\u5f97\u53c8\u6709\u635f\u4e8e\u6d4b\u8bd5\u548c\u7ef4\u62a4\u3002\u5728C\/C++\u8bed\u8a00\u4e2d\uff0c\u51fd\u6570\u7684static\u5c40\u90e8\u53d8\u91cf\u662f\u51fd\u6570\u7684\u5185\u90e8\u5b58\u50a8\u5668\uff0c\u6709\u6216\u8005\u4f7f\u51fd\u6570\u7684\u6548\u80fd\u4e0d\u53ef\u9884\u6d4b\uff0c\u7136\u5219\uff0c\u5e94\u67d0\u51fd\u6570\u7684\u56de\u5230\u503c\u4e3a\u6307\u9488\u95e8\u7c7b\u65f6\uff0c\u5219\u52a1\u987b\u662fSTATIC\u7684\u5c40\u90e8\u53d8\u91cf\u7684\u5730\u5740\u4f5c\u4e3a\u56de\u6765\u503c\uff0c\u82e5\u4e3aAUTO\u79cd\uff0c\u5219\u56de\u5230\u4e3a\u9519\u9488\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u51fd\u6570\uff0c\u5176\u56de\u5230\u503c\uff08\u5373\u6548\u80fd\uff09\u662f\u4e0d\u53ef\u9884\u6d4b\u7684\u3002 <\/p>\n
unsigned int integer_sum( unsigned int base ) <\/p>\n
{ <\/p>\n
unsigned int index; <\/p>\n
static unsigned int sum = \u96f6; \/\/ \u6ce8\u610f\uff0c\u662fstatic\u95e8\u7c7b\u7684\u3002 <\/p>\n
\/\/ \u82e5\u6539\u6210auto\u90e8\u7c7b\uff0c\u5219\u51fd\u6570\u5373\u6210\u4e3a\u53ef\u9884\u6d4b\u3002 <\/p>\n
for (index = \u4e00; index <= base; index++) <\/p>\n
{ <\/p>\n
sum += index; <\/p>\n
} <\/p>\n
return sum; <\/p>\n
} <\/p>\n
\u00bd\u516d-\u4e03\uff1a\u5c3d\u53ef\u80fd\u4e0d\u7528\u7f16\u64b0\u4f9d\u8d56\u4e8e\u5176\u4f59\u51fd\u6570\u5185\u90e8\u5151\u73b0\u7684\u51fd\u6570\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u6b64\u6761\u4e3a\u51fd\u6570\u72ec\u7acb\u6027\u7684\u57fa\u672c\u8981\u6c42\u3002\u56e0\u4e3a\u73b0\u9636\u6bb5\u5927\u591a\u6570\u9ad8\u7ea7\u8bed\u8a00\u90fd\u662f\u6784\u9020\u5316\u7684\uff0c\u4e4b\u6240\u4ee5\u7ecf\u8fc7\u5177\u4f53\u8bed\u8a00\u7684\u8bed\u6cd5\u8981\u6c42\u4e0e\u7f16\u8bd1\u5668\u6548\u80fd\uff0c\u6839\u672c\u5c31\u53ef\u4ee5\u9632\u6b62\u8fd9\u79cd\u72b6\u51b5\u53d1\u4f5c\u3002\u4f46\u5728\u7f16\u8bd1\u8bed\u8a00\u4e2d\uff0c\u56e0\u4e3a\u5176\u7075\u6d3b\u6027\uff0c\u5f88\u53ef\u80fd\u4f7f\u51fd\u6570\u51fa\u73b0\u8fd9\u79cd\u666f\u51b5\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u662f\u5728DOS\u505cTASM\u7684\u6c47\u7f16\u7a0b\u5e8f\u4f8b\u8bc1\u3002\u5386\u7a0bPrint_Msg\u7684\u5151\u73b0\u4f9d\u8d56\u4e8eInput_Msg\u7684\u5177\u4f53\u5151\u73b0\uff0c\u8fd9\u79cd\u7a0b\u5e8f\u662f\u975e\u66f2\u76f4\u6784\u9020\u5316\u7684\uff0c\u96be\u4ee5\u7ef4\u62a4\u3001\u6279\u6539\u3002 <\/p>\n
... \/\/ \u7a0b\u5e8f\u4ee3\u7801 <\/p>\n
proc Print_Msg \/\/ \u5386\u7a0b\uff08\u51fd\u6570\uff09Print_Msg <\/p>\n
... \/\/ \u7a0b\u5e8f\u4ee3\u7801 <\/p>\n
jmp LABEL <\/p>\n
... \/\/ \u7a0b\u5e8f\u4ee3\u7801 <\/p>\n
endp <\/p>\n
proc Input_Msg \/\/ \u8fdb\u7a0b\uff08\u51fd\u6570\uff09Input_Msg <\/p>\n
... \/\/ \u7a0b\u5e8f\u4ee3\u7801 <\/p>\n
LABEL: <\/p>\n
... \/\/ \u7a0b\u5e8f\u4ee3\u7801 <\/p>\n
endp <\/p>\n
\u00bd\u516d-\u516b\uff1a\u907f\u514d\u8bbe\u8ba1\u591a\u53c2\u6570\u51fd\u6570\uff0c\u4e0d\u65bd\u7528\u7684\u53c2\u6570\u4ece\u63a5\u53e3\u4e2d\u53bb\u6389\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u76ee\u7684\u51cf\u5c0f\u51fd\u6570\u95f4\u63a5\u53e3\u7684\u590d\u6742\u5ea6\u3002 <\/p>\n
\u00bd\u516d-\u4e5d\uff1a\u975e\u90e8\u7f72\u51fd\u6570\u5e94\u51cf\u5c0f\u6216\u9632\u6b62\u7edf\u5236\u53c2\u6570\uff0c\u5c3d\u53ef\u80fd\u53ea\u65bd\u7528\u6570\u636e\u53c2\u6570\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u672c\u63d0\u8bae\u76ee\u7684\u662f\u9632\u6b62\u51fd\u6570\u95f4\u7684\u7edf\u5236\u8026\u5408\u3002\u90e8\u7f72\u51fd\u6570\u662f\u6307\u4f9d\u636e\u8f93\u5165\u7684\u8baf\u606f\u95e8\u7c7b\u6216\u7edf\u5236\u4e0b\u4ee4\uff0c\u6765\u8d77\u6b65\u547c\u5e94\u7684\u6548\u80fd\u5b9e\u4e1a\uff08\u5373\u51fd\u6570\u6216\u8fdb\u7a0b\uff09\uff0c\u800c\u81ea\u8eab\u5e76\u4e0d\u5b8c\u6210\u5177\u4f53\u6548\u80fd\u3002\u7edf\u5236\u53c2\u6570\u662f\u6307\u6539\u53d8\u51fd\u6570\u6548\u80fd\u4e3e\u52a8\u7684\u53c2\u6570\uff0c\u5373\u51fd\u6570\u8981\u6839\u636e\u6b64\u53c2\u6570\u6765\u51b3\u8bae\u5177\u4f53\u600e\u4e48\u5de5\u4f5c\u3002\u975e\u90e8\u7f72\u51fd\u6570\u7684\u7edf\u5236\u53c2\u6570\u589e\u52a0\u4e86\u51fd\u6570\u95f4\u7684\u7edf\u5236\u8026\u5408\uff0c\u5f88\u53ef\u80fd\u4f7f\u51fd\u6570\u95f4\u7684\u8026\u5408\u5ea6\u589e\u5927\uff0c\u5e76\u4f7f\u51fd\u6570\u7684\u6548\u80fd\u4e0d\u72ec\u4e00\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u51fd\u6570\u7ed3\u6784\u4e0d\u592a\u5408\u7406\u3002 <\/p>\n
int add_sub( int a, int b, unsigned char add_sub_flg ) <\/p>\n
{ <\/p>\n
if (add_sub_flg == INTEGER_ADD) <\/p>\n
{ <\/p>\n
return (a + b); <\/p>\n
} <\/p>\n
else <\/p>\n
{ <\/p>\n
return (a b); <\/p>\n
} <\/p>\n
} <\/p>\n
\u83ab\u82e5\u5206\u6210\u5982\u6b21\u4e24\u4e2a\u51fd\u6570\u660e\u6670\u3002 <\/p>\n
int add( int a, int b ) <\/p>\n
{ <\/p>\n
return (a + b); <\/p>\n
} <\/p>\n
int sub( int a, int b ) <\/p>\n
{ <\/p>\n
return (a b); <\/p>\n
} <\/p>\n
\u00bd\u516d-\u5341\uff1a\u68c0\u5bdf\u51fd\u6570\u5168\u90e8\u53c2\u6570\u8f93\u5165\u7684\u6709\u6548\u6027\u3002 <\/p>\n
\u00bd\u516d-11\uff1a\u68c0\u5bdf\u51fd\u6570\u5168\u90e8\u975e\u53c2\u6570\u8f93\u5165\u7684\u6709\u6548\u6027\uff0c\u5168\u6570\u636e\u6587\u4ef6\u3001\u516c\u5171\u53d8\u91cf\u7b49\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u51fd\u6570\u7684\u8f93\u5165\u91cd\u8981\u6709\u4e24\u79cd\uff1a\u4e00\u79cd\u662f\u53c2\u6570\u8f93\u5165\uff1b\u53e6\u4e00\u79cd\u662f\u5168\u5c40\u53d8\u91cf\u3001\u6570\u636e\u6587\u4ef6\u7684\u8f93\u5165\uff0c\u5373\u975e\u53c2\u6570\u8f93\u5165\u3002\u51fd\u6570\u5728\u5e94\u7528\u8f93\u5165\u4e8b\u524d\uff0c\u5f53\u5f00\u5c55\u5fc5\u8981\u7684\u68c0\u5bdf\u3002 <\/p>\n
\u00bd\u516d-12\uff1a\u51fd\u6570\u540d\u5e94\u6b63\u786e\u63cf\u8ff0\u51fd\u6570\u7684\u6548\u80fd\u3002 <\/p>\n
\u00bd\u516d-13\uff1a\u65bd\u7528\u52a8\u5bbe\u77ed\u8bed\u4e3a\u65bd\u884c\u67d0\u64cd\u4f5c\u7684\u51fd\u6570\u5b9a\u540d\u3002\u5982\u679c\u662fOOP\u6b65\u9aa4\uff0c\u53ef\u4ee5\u552f\u6709\u52a8\u8bcd\uff08\u540d\u8bcd\u662f\u5bf9\u8c61\u81ea\u8eab\uff09\u3002 <\/p>\n
\u793a\u8303\uff1a\u53c2\u8003\u5982\u6b21\u6a21\u5f0f\u5b9a\u540d\u51fd\u6570\u3002 <\/p>\n
void print_record( unsigned int rec_ind ) ; <\/p>\n
int input_record( void ) ; <\/p>\n
unsigned char get_current_color( void ) ; <\/p>\n
\u63d0\u8bae\u516d-14\uff1a\u907f\u514d\u8fd0\u7528\u65e0\u610f\u4e49\u6216\u542b\u610f\u4e0d\u6e05\u7684\u52a8\u8bcd\u4e3a\u51fd\u6570\u5b9a\u540d\u3002
\u8bf4\u660e\uff1a\u907f\u514d\u7528\u542b\u610f\u4e0d\u6e05\u7684\u52a8\u8bcd\u5982process\u3001handle\u7b49\u4e3a\u51fd\u6570\u5b9a\u540d\uff0c\u7531\u4e8e\u8fd9\u4e9b\u52a8\u8bcd\u5e76\u6ca1\u6709\u8bf4\u660e\u8981\u5177\u4f53\u505a\u4ec0\u4e48\u3002 <\/p>\n
\u63d0\u8bae\u516d-15\uff1a\u51fd\u6570\u7684\u56de\u5230\u503c\u8981\u660e\u767d\u3001\u4e86\u7136\uff0c\u8ba9\u4f7f\u7528\u8005\u4e0d\u5bb9\u6613\u6f20\u89c6\u9519\u5904\u72b6\u51b5\u3002
\u8bf4\u660e\uff1a\u51fd\u6570\u7684\u6bcf\u79cd\u5931\u8bef\u56de\u5230\u503c\u7684\u610f\u601d\u8981\u660e\u6670\u3001\u4e86\u7136\u3001\u6b63\u786e\uff0c\u9632\u6b62\u4f7f\u7528\u8005\u8bef\u7528\u3001\u61c2\u5f97\u9519\u5904\u6216\u6f20\u89c6\u5dee\u9519\u56de\u5230\u7801\u3002 <\/p>\n
\u00bd\u516d-16\uff1a\u9664\u975e\u5fc5\u8981\uff0c\u6700\u597d\u4e0d\u7528\u628a\u4e0e\u51fd\u6570\u56de\u5230\u503c\u90e8\u7c7b\u4e0d\u540c\u7684\u53d8\u91cf\uff0c\u4ee5\u7f16\u8bd1\u7cfb\u7edf\u9ed8\u8bb8\u7684\u53d8\u6362\u6a21\u5f0f\u6216\u631f\u5236\u7684\u53d8\u6362\u5f62\u5f0f\u4f5c\u4e3a\u56de\u6765\u503c\u56de\u5230\u3002 <\/p>\n
\u00bd\u516d-17\uff1a\u8ba9\u51fd\u6570\u5728\u8c03\u7528\u70b9\u663e\u5f97\u6613\u61c2\u3001\u7b80\u5355\u61c2\u5f97\u3002 <\/p>\n
\u00bd\u516d-18\uff1a\u5728\u8c03\u7528\u51fd\u6570\u586b\u7a7a\u53c2\u6570\u65f6\uff0c\u5e94\u5c3d\u53ef\u80fd\u51cf\u5c0f\u6ca1\u6709\u5fc5\u8981\u7684\u9ed8\u8bb8\u6570\u636e\u90e8\u7c7b\u53d8\u6362\u6216\u631f\u5236\u6570\u636e\u95e8\u7c7b\u53d8\u6362\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u7531\u4e8e\u6570\u636e\u95e8\u7c7b\u53d8\u6362\u6216\u591a\u6216\u5c11\u5b58\u5728\u98ce\u9669\u3002 <\/p>\n
\u00bd\u516d-19\uff1a\u907f\u514d\u51fd\u6570\u4e2d\u7528\u4e0d\u7740\u8bdd\u8bed\uff0c\u9632\u6b62\u7a0b\u5e8f\u4e2d\u7684\u6e23\u6ed3\u4ee3\u7801\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u7a0b\u5e8f\u4e2d\u7684\u6e23\u6ed3\u4ee3\u7801\u4e0d\u5149\u5360\u7528\u989d\u5916\u7684\u7a7a\u95f4\uff0c\u5e76\u4e14\u8fd8\u7ecf\u5e38\u5f71\u54cd\u7a0b\u5e8f\u7684\u6548\u80fd\u4e0e\u6027\u80fd\uff0c\u5f88\u53ef\u80fd\u7ed9\u7a0b\u5e8f\u7684\u6d4b\u8bd5\u3001\u7ef4\u62a4\u7b49\u4fc3\u6210\u7528\u4e0d\u7740\u7684\u70e6\u52b3\u3002 <\/p>\n
\u00bd\u516d-20\uff1a\u9632\u6b62\u628a\u6ca1\u8054\u7cfb\u5173\u7cfb\u7684\u8bdd\u8bed\u653e\u5230\u4e00\u4e2a\u51fd\u6570\u4e2d\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u9632\u6b62\u51fd\u6570\u6216\u8fdb\u7a0b\u5185\u51fa\u73b0\u968f\u673a\u5185\u805a\u3002\u968f\u673a\u5185\u805a\u662f\u6307\u5c06\u6ca1\u8054\u7cfb\u5173\u7cfb\u6216\u8054\u7cfb\u5173\u7cfb\u5f88\u5f31\u7684\u8bdd\u8bed\u653e\u5230\u540c\u4e00\u4e2a\u51fd\u6570\u6216\u8fc7\u7a0b\u4e2d\u3002\u968f\u673a\u5185\u805a\u7ed9\u51fd\u6570\u6216\u5386\u7a0b\u7684\u7ef4\u62a4\u3001\u6d4b\u8bd5\u53ca\u4e4b\u540e\u7684\u5347\u683c\u7b49\u9020\u6210\u4e86\u4e0d\u65b9\u4fbf\uff0c\u4e0e\u6b64\u540c\u65f6\u4e5f\u4f7f\u51fd\u6570\u6216\u8fdb\u7a0b\u7684\u6548\u80fd\u4e0d\u660e\u786e\u3002\u5e94\u7528\u968f\u673a\u5185\u805a\u51fd\u6570\uff0c\u7ecf\u5e38\u7b80\u5355\u51fa\u73b0\u5728\u4e00\u79cd\u65bd\u7528\u5904\u6240\u4e9f\u9700\u6539\u5584\u6b64\u51fd\u6570\uff0c\u800c\u53e6\u4e00\u79cd\u65bd\u7528\u5904\u6240\u53c8\u4e0d\u5141\u8bb8\u8fd9\u79cd\u6539\u5584\uff0c\u6545\u6b64\u9677\u5165\u56f0\u5883\u3002 <\/p>\n
\u5728\u7f16\u7a0b\u65f6\uff0c\u5e38\u5e38\u78b0\u5230\u5728\u4e0d\u540c\u51fd\u6570\u4e2d\u5e94\u7528\u96f7\u540c\u7684\u4ee3\u7801\uff0c\u597d\u591a\u5f00\u53d1\u4eba\u5458\u90fd\u613f\u628a\u8fd9\u4e9b\u4ee3\u7801\u63d0\u51fa\u6765\uff0c\u5e76\u7ed3\u6210\u4e00\u4e2a\u65b0\u51fd\u6570\u3002\u82e5\u8fd9\u4e9b\u4ee3\u7801\u8054\u7cfb\u5173\u7cfb\u8f83\u5927\u5e76\u4e14\u662f\u5b8c\u6210\u4e00\u4e2a\u6548\u80fd\u7684\uff0c\u90a3\u4e48\u8fd9\u79cd\u7ed3\u6784\u662f\u5408\u7406\u7684\uff0c\u4e0d\u7136\u8fd9\u79cd\u7ed3\u6784\u5c06\u53d1\u751f\u968f\u673a\u5185\u805a\u7684\u51fd\u6570\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u51fd\u6570\u4e43\u662f\u4e00\u79cd\u968f\u673a\u5185\u805a\u3002 <\/p>\n
void Init_Var( void ) <\/p>\n
{ <\/p>\n
Rect.length = \u96f6; <\/p>\n
Rect.width = \u96f6; \/* \u521d\u59cb\u5316\u77e9\u5f62\u7684\u957f\u4e0e\u9614 *\/ <\/p>\n
Point.x = \u5341; <\/p>\n
Point.y = \u5341; \/* \u521d\u59cb\u5316\u201c\u70b9\u201d\u7684\u5ea7\u6807 *\/ <\/p>\n
} <\/p>\n
\u77e9\u5f62\u7684\u957f\u3001\u9614\u4e0e\u70b9\u7684\u5ea7\u6807\u6839\u672c\u6ca1\u4efb\u4f55\u5173\u7cfb\uff0c\u6545\u4e4b\u4e0a\u51fd\u6570\u662f\u968f\u673a\u5185\u805a\u3002 <\/p>\n
\u5f53\u5982\u6b21\u5206\u6210\u4e24\u4e2a\u51fd\u6570\uff1a <\/p>\n
void Init_Rect( void ) <\/p>\n
{ <\/p>\n
Rect.length = \u96f6; <\/p>\n
Rect.width = \u96f6; \/* \u521d\u59cb\u5316\u77e9\u5f62\u7684\u957f\u4e0e\u9614 *\/ <\/p>\n
} <\/p>\n
void Init_Point( void ) <\/p>\n
{ <\/p>\n
Point.x = \u5341; <\/p>\n
Point.y = \u5341; \/* \u521d\u59cb\u5316\u201c\u70b9\u201d\u7684\u5ea7\u6807 *\/ <\/p>\n
} <\/p>\n
\u00bd\u516d-21\uff1a\u5982\u5176\u591a\u6bb5\u4ee3\u7801\u53cd\u590d\u505a\u540c\u4e00\u4ef6\u4e8b\u513f\uff0c\u90a3\u4e48\u5728\u51fd\u6570\u7684\u533a\u5212\u4e0a\u6216\u8bb8\u5b58\u5728\u95ee\u9898\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u82e5\u6b64\u6bb5\u4ee3\u7801\u5404\u8bdd\u8bed\u5176\u95f4\u6709\u5b9e\u8d28\u6027\u8054\u7cfb\u5173\u7cfb\u5e76\u4e14\u662f\u5b8c\u6210\u540c\u4e00\u4ef6\u6548\u80fd\u7684\uff0c\u90a3\u4e48\u53ef\u601d\u8003\u628a\u6b64\u6bb5\u4ee3\u7801\u7ed3\u6784\u6210\u4e00\u4e2a\u65b0\u7684\u51fd\u6570\u3002 <\/p>\n
\u00bd\u516d-22\uff1a\u6548\u80fd\u4e0d\u660e\u786e\u8f83\u5c0f\u7684\u51fd\u6570\uff0c\u7279\u522b\u662f\u4ec5\u6709\u4e00\u4e2a\u4e0a\u53f8\u51fd\u6570\u8c03\u7528\u5b83\u65f6\uff0c\u5e94\u8bd5\u8651\u628a\u5b83\u5408\u62e2\u5230\u4e0a\u53f8\u51fd\u6570\u4e2d\uff0c\u800c\u4e0d\u987b\u72ec\u81ea\u5b58\u5728\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u6a21\u5757\u4e2d\u51fd\u6570\u533a\u5212\u7684\u8fc7\u5269\uff0c\u6b63\u5e38\u4f1a\u4f7f\u51fd\u6570\u95f4\u7684\u63a5\u53e3\u53d8\u5f97\u590d\u6742\u3002\u4e4b\u6240\u4ee5\u8fc7\u5c0f\u7684\u51fd\u6570\uff0c\u7279\u522b\u662f\u6247\u5165\u5f88\u4f4e\u7684\u6216\u6548\u80fd\u4e0d\u660e\u786e\u7684\u51fd\u6570\uff0c\u4e0d\u503c\u5f97\u72ec\u81ea\u5b58\u5728\u3002 <\/p>\n
\u00bd\u516d-23\uff1a\u8bbe\u8ba1\u9ad8\u6247\u5165\u3001\u5408\u7406\u6247\u51fa\uff08\u5c0f\u4e8e\u4e03\uff09\u7684\u51fd\u6570\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u6247\u51fa\u662f\u6307\u4e00\u4e2a\u51fd\u6570\u76f4\u63a5\u8c03\u7528\uff08\u7edf\u5236\uff09\u5176\u5b83\u51fd\u6570\u7684\u6570\u989d\uff0c\u800c\u6247\u5165\u662f\u6307\u6709\u51e0\u591a\u4e0a\u53f8\u51fd\u6570\u8c03\u7528\u5b83\u3002 <\/p>\n
\u6247\u51fa\u8fc7\u5927\uff0c\u8868\u660e\u51fd\u6570\u8fc7\u5934\u590d\u6742\uff0c\u6025\u9700\u7edf\u5236\u548c\u534f\u8c03\u8fc7\u5269\u7684\u4e0b\u5c5e\u51fd\u6570\uff1b\u800c\u6247\u51fa\u8fc7\u5c0f\uff0c\u5982\u8001\u662f\u4e00\uff0c\u8868\u660e\u51fd\u6570\u7684\u8c03\u7528\u5c42\u6b21\u6216\u8bb8\u8fc7\u5269\uff0c\u8fd9\u4e48\u6709\u635f\u7a0b\u5e8f\u7ffb\u9605\u548c\u51fd\u6570\u6784\u9020\u7684\u5206\u6790\uff0c\u800c\u4e14\u7a0b\u5e8f\u8fd0\u884c\u65f6\u4f1a\u5bf9\u7cfb\u7edf\u8d44\u6e90\u5982\u5806\u6808\u7a7a\u95f4\u7b49\u4fc3\u6210\u538b\u529b\u3002\u51fd\u6570\u8f83\u5408\u7406\u7684\u6247\u51fa\uff08\u652f\u914d\u51fd\u6570\u9664\u6b64\u4e4b\u5916\uff09\u901a\u5e38\u662f\u4e09-\u4e94\u3002\u6247\u51fa\u592a\u5927\uff0c\u6b63\u5e38\u662f\u56e0\u4e3a\u532e\u7f3a\u4e2d\u95f4\u5c42\u6b21\uff0c\u53ef\u9002\u5f53\u589e\u591a\u4e2d\u95f4\u5c42\u6b21\u7684\u51fd\u6570\u3002\u6247\u51fa\u592a\u5c0f\uff0c\u53ef\u628a\u90e8\u4e0b\u51fd\u6570\u66f4\u8fdb\u4e00\u6b65\u5206\u89e3\u591a\u4e2a\u51fd\u6570\uff0c\u6216\u5408\u62e2\u5230\u4e0a\u53f8\u51fd\u6570\u4e2d\u3002\u5f53\u7136\u5206\u89e3\u6216\u5408\u9f99\u51fd\u6570\u65f6\uff0c\u4e0d\u80fd\u6539\u53d8\u8981\u5151\u73b0\u7684\u6548\u80fd\uff0c\u4e5f\u4e0d\u80fd\u8fdd\u53cd\u51fd\u6570\u95f4\u7684\u72ec\u7acb\u6027\u3002 <\/p>\n
\u6247\u5165\u8d8a\u5927\uff0c\u8868\u660e\u5e94\u7528\u6b64\u51fd\u6570\u7684\u4e0a\u53f8\u51fd\u6570\u8d8a\u591a\uff0c\u8fd9\u4e48\u7684\u51fd\u6570\u65bd\u7528\u6548\u7387\u9ad8\uff0c\u4f46\u4e0d\u80fd\u8fdd\u53cd\u51fd\u6570\u95f4\u7684\u72ec\u7acb\u6027\u800c\u7eaf\u7cb9\u5730\u8ffd\u6c42\u9ad8\u6247\u5165\u3002\u516c\u5171\u6a21\u5757\u4e2d\u7684\u51fd\u6570\u53ca\u5e95\u5c42\u51fd\u6570\u5e94\u8be5\u6709\u8f83\u9ad8\u7684\u6247\u5165\u3002 <\/p>\n
\u8f83\u6bd4\u5f88\u597d\u7684\u8f6f\u4ef6\u6784\u9020\u901a\u5e38\u662f\u9ad8\u5c42\u51fd\u6570\u7684\u6247\u51fa\u8f83\u9ad8\uff0c\u4e2d\u5c42\u51fd\u6570\u7684\u6247\u51fa\u8f83\u5c11\uff0c\u800c\u5e95\u5c42\u51fd\u6570\u5219\u6247\u5165\u5230\u516c\u5171\u6a21\u5757\u4e2d\u3002 <\/p>\n
\u00bd\u516d-24\uff1a\u51cf\u5c0f\u51fd\u6570\u81ea\u8eab\u6216\u51fd\u6570\u95f4\u7684\u9012\u5f52\u8c03\u7528\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u9012\u5f52\u8c03\u7528\u7279\u522b\u662f\u51fd\u6570\u95f4\u7684\u9012\u5f52\u8c03\u7528\uff08\u5982A->B->C->A\uff09\uff0c\u5f71\u54cd\u7a0b\u5e8f\u7684\u53ef\u7406\u89e3\u6027\uff1b\u9012\u5f52\u8c03\u7528\u901a\u5e38\u90fd\u5360\u7528\u8f83\u591a\u7684\u7cfb\u7edf\u8d44\u6e90\uff08\u5982\u6808\u7a7a\u95f4\uff09\uff1b\u9012\u5f52\u8c03\u7528\u5bf9\u7a0b\u5e8f\u7684\u6d4b\u8bd5\u6709\u4e00\u5b9a\u5f71\u54cd\u3002\u6545\u9664\u975e\u4e3a\u67d0\u4e9b\u7b97\u6cd5\u6216\u6548\u80fd\u7684\u5151\u73b0\u4fbf\u5229\uff0c\u5f53\u51cf\u5c0f\u6ca1\u5fc5\u8981\u7684\u9012\u5f52\u8c03\u7528\u3002 <\/p>\n
\u00bd\u516d-25\uff1a\u4ed4\u7ec6\u5206\u6790\u6a21\u5757\u7684\u6548\u80fd\u53ca\u6027\u80fd\u9700\u6c42\uff0c\u5e76\u66f4\u4e0a\u4e00\u5c42\u697c\u7ec6\u5206\uff0c\u4e0e\u6b64\u540c\u65f6\u82e5\u6709\u5fc5\u8981\u753b\u51fa\u76f8\u5173\u6570\u636e\u6d41\u56fe\uff0c\u636e\u6b64\u6765\u8fdb\u5c55\u6a21\u5757\u7684\u51fd\u6570\u533a\u5212\u4e0e\u673a\u6784\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u51fd\u6570\u7684\u533a\u5212\u4e0e\u5355\u4f4d\u662f\u6a21\u5757\u7684\u5151\u73b0\u8fc7\u7a0b\u4e2d\u5f88\u8981\u5bb3\u7684\u65b9\u6cd5\uff0c\u4f55\u4ee5\u533a\u5212\u51fa\u5408\u7406\u7684\u51fd\u6570\u6784\u9020\uff0c\u5173\u7cfb\u5230\u6a21\u5757\u7684\u7ec8\u6781\u6548\u7387\u548c\u53ef\u7ef4\u62a4\u6027\u3001\u53ef\u6d4b\u6027\u7b49\u3002\u4f9d\u636e\u6a21\u5757\u7684\u6548\u80fd\u56fe\u6216\/\u53ca\u6570\u636e\u6d41\u56fe\u6295\u5c04\u51fa\u51fd\u6570\u6784\u9020\u662f\u60ef\u7528\u6b65\u9aa4\u4e4b\u4e00\u3002 <\/p>\n
\u00bd\u516d-26\uff1a\u6539\u5584\u6a21\u5757\u4e2d\u51fd\u6570\u7684\u6784\u9020\uff0c\u51cf\u4f4e\u51fd\u6570\u95f4\u7684\u8026\u5408\u5ea6\uff0c\u5e76\u62d4\u9ad8\u51fd\u6570\u7684\u72ec\u7acb\u6027\u4ee5\u53ca\u4ee3\u7801\u53ef\u8bfb\u6027\u3001\u6548\u7387\u548c\u53ef\u7ef4\u62a4\u6027\u3002\u4f18\u5316\u51fd\u6570\u6784\u9020\u65f6\uff0c\u8981\u4fe1\u5b88\u4ee5\u6b21\u51c6\u5219\uff1a <\/p>\n
\uff08\u4e00\uff09\u4e0d\u80fd\u5f71\u54cd\u6a21\u5757\u6548\u80fd\u7684\u5151\u73b0\u3002 <\/p>\n
\uff08\u4e8c\uff09\u8ba4\u8ba4\u771f\u771f\u89c6\u5bdf\u6a21\u5757\u6216\u51fd\u6570\u5931\u8bef\u5904\u7f6e\u53ca\u6a21\u5757\u7684\u6027\u80fd\u8981\u6c42\u5e76\u8fdb\u5c55\u5b8c\u7f8e\u3002 <\/p>\n
\uff08\u4e09\uff09\u7ecf\u8fc7\u5206\u89e3\u6216\u5f52\u62e2\u51fd\u6570\u6765\u6539\u5584\u8f6f\u4ef6\u6784\u9020\u3002 <\/p>\n
\uff08\u56db\uff09\u89c6\u5bdf\u51fd\u6570\u7684\u89c4\u6a21\uff0c\u8fc7\u5927\u7684\u8981\u8fdb\u5c55\u5206\u89e3\u3002 <\/p>\n
\uff08\u4e94\uff09\u51cf\u4f4e\u51fd\u6570\u95f4\u63a5\u53e3\u7684\u590d\u6742\u5ea6\u3002 <\/p>\n
\uff08\u516d\uff09\u4e0d\u540c\u5c42\u6b21\u7684\u51fd\u6570\u8c03\u7528\u8981\u6709\u8f83\u5408\u7406\u7684\u6247\u5165\u3001\u6247\u51fa\u3002 <\/p>\n
\uff08\u4e03\uff09\u51fd\u6570\u6548\u80fd\u5e94\u53ef\u9884\u6d4b\u3002 <\/p>\n
\uff08\u516b\uff09\u589e\u9ad8\u51fd\u6570\u5185\u805a\u3002\uff08\u5355\u8c03\u6548\u80fd\u7684\u51fd\u6570\u5185\u805a\u6700\u9ad8\uff09 <\/p>\n
\u8bf4\u660e\uff1a\u5bf9\u521d\u59cb\u533a\u5212\u540e\u7684\u51fd\u6570\u6784\u9020\u5e94\u5f00\u5c55\u6539\u5584\u3001\u4f18\u5316\uff0c\u4f7f\u4e4b\u66f4\u662f\u5408\u7406\u3002 <\/p>\n
\u00bd\u516d-27\uff1a\u5728\u591a\u4efb\u52a1\u64cd\u4f5c\u7cfb\u7edf\u7684\u73af\u5883\u4e0b\u7f16\u7a0b\uff0c\u8981\u6ce8\u610f\u51fd\u6570\u53ef\u91cd\u5165\u6027\u7684\u7ed3\u6784\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u53ef\u91cd\u5165\u6027\u662f\u6307\u51fd\u6570\u53ef\u4ee5\u88ab\u591a\u4e2a\u4efb\u52a1\u5386\u7a0b\u8c03\u7528\u3002\u5728\u591a\u4efb\u52a1\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u51fd\u6570\u662f\u4e0d\u662f\u5177\u6709\u53ef\u91cd\u5165\u6027\u662f\u662f\u975e\u975e\u5e38\u91cd\u8981\u7684\uff0c\u7531\u4e8e\u8fd9\u662f\u591a\u4e2a\u8fc7\u7a0b\u53ef\u4ee5\u5171\u7528\u6b64\u51fd\u6570\u7684\u5148\u51b3\u6761\u4ef6\u3002\u9664\u6b64\u4ee5\u5916\uff0c\u7f16\u8bd1\u5668\u662f\u4e0d\u662f\u63d0\u4f9b\u53ef\u91cd\u5165\u51fd\u6570\u5e93\uff0c\u4e0e\u5b83\u6240\u670d\u52a1\u7684\u64cd\u4f5c\u7cfb\u7edf\u76f8\u5e72\uff0c\u60df\u72ec\u64cd\u4f5c\u7cfb\u7edf\u662f\u591a\u4efb\u52a1\u65f6\uff0c\u7f16\u8bd1\u5668\u624d\u6709\u6216\u8005\u63d0\u4f9b\u53ef\u91cd\u5165\u51fd\u6570\u5e93\u3002\u5982DOS\u505cBC\u548cMSC\u7b49\u5c31\u4e0d\u5177\u5907\u53ef\u91cd\u5165\u51fd\u6570\u5e93\uff0c\u7531\u4e8eDOS\u662f\u5355\u7528\u6237\u5355\u4efb\u52a1\u64cd\u4f5c\u7cfb\u7edf\u3002 <\/p>\n
\u00bd\u516d-28\uff1a\u907f\u514d\u5e94\u7528BOOL\u53c2\u6570\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u7f18\u6545\u67092\uff0c\u5176\u4e00\u662fBOOL\u53c2\u6570\u503c\u65e0\u610f\u4e49\uff0cTURE\/FALSE\u7684\u542b\u610f\u662f\u975e\u66f2\u76f4\u5e38\u6a21\u6a21\u7cca\u7cca\u7684\uff0c\u5728\u8c03\u7528\u65f6\u5f88\u96be\u6653\u5f97\u8be5\u53c2\u6570\u7a76\u7adf\u4f20\u8bdd\u7684\u662f\u4ec0\u4e48\u610f\u601d\uff1b\u5176\u4e8c\u662fBOOL\u53c2\u6570\u503c\u6709\u635f\u4e8e\u6269\u5f20\u3002\u518d\u6709NULL\u4e5f\u662f\u4e00\u4e2a\u65e0\u610f\u4e49\u7684\u5355\u7eaf\u8bcd\u3002 <\/p>\n
\u00bd\u516d-29\uff1a \u81f3\u4e8e\u63d0\u4f9b\u4e86\u56de\u5230\u503c\u7684\u51fd\u6570\uff0c\u5728\u5f15\u8ff0\u65f6\u6700\u597d\u5e94\u7528\u5176\u56de\u5230\u503c\u3002 <\/p>\n
\u00bd\u516d-30\uff1a\u5e94\u4e00\u4e2a\u5386\u7a0b\uff08\u51fd\u6570\uff09\u4e2d\u5bf9\u8f83\u957f\u53d8\u91cf\uff08\u901a\u5e38\u662f\u6784\u9020\u7684\u6210\u5458\uff09\u6709\u8f83\u591a\u6458\u5f15\u65f6\uff0c\u53ef\u4ee5\u7528\u4e00\u4e2a\u610f\u601d\u5bf9\u7b49\u7684\u5b8f\u9876\u66ff\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u8fd9\u4e48\u53ef\u4ee5\u589e\u591a\u7f16\u7a0b\u6548\u7387\u548c\u7a0b\u5e8f\u7684\u53ef\u8bfb\u6027\u3002 <\/p>\n
\u793a\u8303\uff1a\u5728\u67d0\u8fc7\u7a0b\u4e2d\u8f83\u591a\u5f15\u8ff0TheReceiveBuffer[FirstSocket].byDataPtr\uff0c <\/p>\n
\u5219\u53ef\u4ee5\u900f\u8fc7\u4ee5\u6b21\u5b8f\u5b9a\u4e49\u6765\u9876\u66ff\uff1a <\/p>\n
# define pSOCKDATA TheReceiveBuffer[FirstScoket].byDataPtr <\/p>\n
\u4e03 \u53ef\u6d4b\u6027
\u00b9\u4e03-\u4e00\uff1a\u5728\u540c\u4e00\u9879\u76ee\u7ec4\u6216\u4ea7\u54c1\u7ec4\u5185\uff0c\u8981\u6709\u4e00\u5957\u4e00\u81f4\u7684\u4e3a\u96c6\u6210\u6d4b\u8bd5\u4e0e\u7cfb\u7edf\u8054\u8c03\u9884\u5907\u7684\u8c03\u6d4b\u5f00\u5173\u53ca\u547c\u5e94\u6253\u5370\u51fd\u6570\uff0c\u800c\u4e14\u8981\u6709\u8be6\u7ec6\u7684\u8bf4\u660e\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u672c\u5b88\u5219\u662f\u9488\u5bf9\u9879\u76ee\u7ec4\u6216\u4ea7\u54c1\u7ec4\u7684\u3002 <\/p>\n
\u00b9\u4e03-\u4e8c\uff1a\u5728\u540c\u4e00\u9879\u76ee\u7ec4\u6216\u4ea7\u54c1\u7ec4\u5185\uff0c\u8c03\u6d4b\u6253\u5370\u51fa\u7684\u4fe1\u606f\u4e32\u7684\u683c\u5f0f\u8981\u6709\u4e00\u81f4\u7684\u6a21\u5f0f\u3002\u4fe1\u606f\u4e32\u4e2d\u8d77\u7801\u8981\u6709\u6240\u5728\u6a21\u5757\u540d\uff08\u6216\u6e90\u6587\u4ef6\u540d\uff09\u53ca\u884c\u53f7\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u4e00\u81f4\u7684\u8c03\u6d4b\u4fe1\u606f\u683c\u5f0f\u6613\u4e8e\u96c6\u6210\u6d4b\u8bd5\u3002 <\/p>\n
\u00b9\u4e03-\u4e09\uff1a\u7f16\u7a0b\u7684\u4e0e\u6b64\u540c\u65f6\u8981\u4e3a\u5355\u5143\u6d4b\u8bd5\u6289\u62e9\u6070\u5f53\u7684\u6d4b\u8bd5\u70b9\uff0c\u5e76\u8ba4\u771f\u7ed3\u6784\u6d4b\u8bd5\u4ee3\u7801\u3001\u6d4b\u8bd5\u5de5\u4f8b\uff0c\u4e0e\u6b64\u540c\u65f6\u4ed8\u51fa\u660e\u786e\u7684\u8be0\u91ca\u8bf4\u660e\u3002\u6d4b\u8bd5\u4ee3\u7801\u4e00\u90e8\u5206\u5e94\u4f5c\u4e3a\uff08\u6a21\u5757\u4e2d\u7684\uff09\u4e00\u4e2a\u5934\u6a21\u5757\uff0c\u4ee5\u4fbf\u5229\u6d4b\u8bd5\u4ee3\u7801\u5728\u6a21\u5757\u4e2d\u7684\u88c5\u914d\u4e0e\u62c6\u5378\uff08\u7ecf\u8fc7\u8c03\u6d4b\u5f00\u5173\uff09\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u4e3a\u5355\u5143\u6d4b\u8bd5\u800c\u9884\u5907\u3002 <\/p>\n
\u00b9\u4e03-\u56db\uff1a\u5728\u8fdb\u5c55\u96c6\u6210\u6d4b\u8bd5\/\u7cfb\u7edf\u8054\u8c03\u4e8b\u524d\uff0c\u8981\u7ed3\u6784\u597d\u6d4b\u8bd5\u73af\u5883\u3001\u6d4b\u8bd5\u9879\u76ee\u53ca\u6d4b\u8bd5\u5de5\u4f8b\uff0c\u4e0e\u6b64\u540c\u65f6\u4ed4\u7ec6\u5206\u6790\u5e76\u4f18\u5316\u6d4b\u8bd5\u5de5\u4f8b\uff0c\u4ee5\u589e\u9ad8\u6d4b\u8bd5\u6548\u7387\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u7f8e\u7684\u6d4b\u8bd5\u5de5\u4f8b\u5e94\u5c3d\u91cf\u6a21\u62df\u51fa\u7a0b\u5e8f\u6240\u78b0\u5230\u7684\u8fb9\u5883\u503c\u3001\u5404\u79cd\u590d\u6742\u73af\u5883\u53ca\u4e00\u4e9b\u6781\u7aef\u666f\u51b5\u7b49\u3002 <\/p>\n
\u00b9\u4e03-\u4e94\uff1a\u8fd0\u7528\u9884\u8a00\u6765\u53d1\u73b0\u8f6f\u4ef6\u95ee\u9898\uff0c\u589e\u9ad8\u4ee3\u7801\u53ef\u6d4b\u6027\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u9884\u8a00\u662f\u5bf9\u67d0\u79cd\u5047\u60f3\u6761\u4ef6\u8fdb\u884c\u68c0\u67e5\uff08\u53ef\u7406\u89e3\u4e3a\u82e5\u6761\u4ef6\u6210\u7acb\u5219\u65e0\u52a8\u4f5c\uff0c\u4e0d\u7136\u5e94\u6c47\u62a5\uff09\uff0c\u5b83\u53ef\u4ee5\u9ad8\u901f\u53d1\u73b0\u5e76\u5b9a\u4f4d\u8f6f\u4ef6\u95ee\u9898\uff0c\u4e0e\u6b64\u540c\u65f6\u5bf9\u7cfb\u7edf\u5dee\u9519\u8fdb\u5c55\u81ea\u52a8\u62a5\u8b66\u3002\u9884\u8a00\u53ef\u4ee5\u5bf9\u5728\u7cfb\u7edf\u4e2d\u6697\u85cf\u5f88\u6df1\uff0c\u7528\u5176\u5b83\u624b\u6bb5\u6781\u96be\u53d1\u73b0\u7684\u95ee\u9898\u8fdb\u5c55\u5b9a\u4f4d\uff0c\u6545\u800c\u7f29\u6c34\u8f6f\u4ef6\u95ee\u9898\u5b9a\u4f4d\u65f6\u95f4\uff0c\u62d4\u9ad8\u7cfb\u7edf\u7684\u53ef\u6d4b\u6027\u3002\u73b0\u5b9e\u8fd0\u7528\u65f6\uff0c\u53ef\u6839\u636e\u5177\u4f53\u60c5\u51b5\u7075\u4fbf\u5730\u8bbe\u8ba1\u9884\u8a00\u3002 <\/p>\n
\u793a\u8303\uff1a\u4e0b\u8fb9\u662fC\u8bed\u8a00\u4e2d\u7684\u4e00\u4e2a\u9884\u8a00\uff0c\u7528\u5b8f\u6765\u8bbe\u8ba1\u7684\u3002\uff08\u5185\u4e2dNULL\u4e3a\u96f6L\uff09 <\/p>\n
#ifdef _EXAM_ASSERT_TEST_ \/\/ \u82e5\u65bd\u7528\u9884\u8a00\u6d4b\u8bd5 <\/p>\n
void exam_assert( char * file_name, unsigned int line_no ) <\/p>\n
{ <\/p>\n
printf( \"\/n[EXAM]Assert failed: %s, line %u\/n\", <\/p>\n
file_name, line_no ); <\/p>\n
abort( ); <\/p>\n
} <\/p>\n
#define EXAM_ASSERT( condition ) <\/p>\n
if (condition) \/\/ \u82e5\u6761\u4ef6\u6210\u7acb\uff0c\u5219\u65e0\u52a8\u4f5c <\/p>\n
NULL; <\/p>\n
else \/\/ \u4e0d\u7136\u6c47\u62a5 <\/p>\n
exam_assert( __FILE__, __LINE__ ) <\/p>\n
#else \/\/ \u82e5\u4e0d\u65bd\u7528\u9884\u8a00\u6d4b\u8bd5 <\/p>\n
#define EXAM_ASSERT(condition) NULL <\/p>\n
#endif \/* end of ASSERT *\/ <\/p>\n
\u00b9\u4e03-\u516d\uff1a\u7528\u9884\u8a00\u6765\u68c0\u67e5\u7a0b\u5e8f\u4e00\u822c\u8fd0\u884c\u65f6\u4e0d\u5e94\u53d1\u4f5c\u4f46\u5728\u8c03\u6d4b\u65f6\u6709\u53ef\u80fd\u53d1\u751f\u7684\u975e\u6cd5\u72b6\u51b5\u3002 <\/p>\n
\u00b9\u4e03-\u4e03\uff1a\u4e0d\u80fd\u7528\u9884\u8a00\u6765\u68c0\u5bdf\u7ec8\u6781\u4ea7\u54c1\u80af\u5b9a\u4f1a\u51fa\u73b0\u4e14\u52a1\u5fc5\u5904\u7f6e\u7684\u9519\u5904\u666f\u51b5\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u9884\u8a00\u662f\u7528\u4e8e\u5904\u7f6e\u4e0d\u5e94\u8be5\u53d1\u4f5c\u7684\u5dee\u9519\u666f\u51b5\u7684\uff0c\u5173\u4e8e\u53ef\u80fd\u4f1a\u53d1\u4f5c\u7684\u4e14\u52a1\u5fc5\u5904\u7f6e\u7684\u666f\u51b5\u8981\u5199\u9632\u9519\u7a0b\u5e8f\uff0c\u800c\u4e0d\u662f\u9884\u8a00\u3002\u5982\u67d0\u6a21\u5757\u6536\u5230\u5176\u5b83\u6a21\u5757\u6216\u94fe\u9014\u4e2d\u7684\u8baf\u606f\u540e\uff0c\u8981\u5bf9\u8baf\u606f\u7684\u5408\u7406\u6027\u8fdb\u884c\u68c0\u67e5\uff0c\u6b64\u8fdb\u7a0b\u4e3a\u901a\u5e38\u7684\u5dee\u9519\u68c0\u5bdf\uff0c\u4e0d\u80fd\u7528\u9884\u8a00\u6765\u5151\u73b0\u3002 <\/p>\n
\u00b9\u4e03-\u516b\uff1a\u5bf9\u8f83\u590d\u6742\u7684\u9884\u8a00\u52a0\u4e0a\u660e\u786e\u7684\u8be0\u91ca\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u4e3a\u590d\u6742\u7684\u9884\u8a00\u52a0\u8be0\u91ca\uff0c\u53ef\u6f84\u6e05\u9884\u8a00\u542b\u610f\u5e76\u51cf\u5c0f\u7528\u4e0d\u7740\u7684\u8bef\u7528\u3002 <\/p>\n
\u00b9\u4e03-\u4e5d\uff1a\u7528\u9884\u8a00\u786e\u8ba4\u51fd\u6570\u7684\u53c2\u6570\u3002 <\/p>\n
\u793a\u8303\uff1a\u5047\u5b9a\u67d0\u51fd\u6570\u53c2\u6570\u4e2d\u6709\u4e00\u4e2a\u6307\u9488\uff0c\u90a3\u4e48\u8fd0\u7528\u6307\u9488\u524d\u53ef\u5bf9\u5b83\u7a3d\u67e5\uff0c\u5982\u6b21\u3002 <\/p>\n
int exam_fun( unsigned char *str ) <\/p>\n
{ <\/p>\n
EXAM_ASSERT( str != NULL ); \/\/ \u7528\u9884\u8a00\u68c0\u5bdf\u201c\u5047\u60f3\u6307\u9488\u4e0d\u4e3a\u7a7a\u201d\u8fd9\u4e2a\u6761\u4ef6 <\/p>\n
... \/\/other program code <\/p>\n
} <\/p>\n
\u00b9\u4e03-\u5341\uff1a\u7528\u9884\u8a00\u8d23\u4efb\u4e66\u6ca1\u5b9a\u4e49\u7684\u7279\u5f81\u6216\u6548\u80fd\u4e0d\u88ab\u8fd0\u7528\u3002 <\/p>\n
\u793a\u8303\uff1a\u5047\u5b9a\u67d0\u901a\u8baf\u6a21\u5757\u5728\u8bbe\u8ba1\u65f6\uff0c\u9884\u5907\u63d0\u4f9b\u201c\u65e0\u8054\u63a5\u201d\u548c\u201c\u8054\u63a5\u201d \u8fd9\u4e24\u79cd\u4e1a\u52a1\u3002\u4f46\u76ee\u524d\u7684\u7248\u672c\u4e2d\u4ec5\u5151\u73b0\u4e86\u201c\u65e0\u8054\u63a5\u201d\u4e1a\u52a1\uff0c\u4e14\u5728\u6b64\u7248\u672c\u7684\u6b63\u5f0f\u520a\u884c\u7248\u4e2d\uff0c\u7528\u6237\uff08\u4e0a\u5c42\u6a21\u5757\uff09\u4e0d\u5e94\u53d1\u4f5c\u201c\u8054\u63a5\u201d\u4e1a\u52a1\u7684\u8bf7\u6c42\uff0c\u90a3\u4e48\u5728\u6d4b\u8bd5\u65f6\u53ef\u7528\u9884\u8a00\u68c0\u5bdf\u7528\u6237\u662f\u4e0d\u662f\u8fd0\u7528\u201c\u8054\u63a5\u201d\u4e1a\u52a1\u3002\u5982\u6b21\u3002 <\/p>\n
#define EXAM_CONNECTIONLESS \u96f6 \/\/ \u65e0\u8fde\u63a5\u4e1a\u52a1 <\/p>\n
#define EXAM_CONNECTION \u4e00 \/\/ \u8054\u63a5\u4e1a\u52a1 <\/p>\n
int msg_process( EXAM_MESSAGE *msg ) <\/p>\n
{ <\/p>\n
unsigned char service; \/* message service class *\/ <\/p>\n
EXAM_ASSERT( msg != NULL ); <\/p>\n
service = get_msg_service_class( msg ); <\/p>\n
EXAM_ASSERT( service != EXAM_CONNECTION ); \/\/ \u5047\u60f3\u4e0d\u8fd0\u7528\u8054\u63a5\u4e1a\u52a1 <\/p>\n
... \/\/other program code <\/p>\n
} <\/p>\n
\u00b9\u4e03-11\uff1a\u7528\u9884\u8a00\u5bf9\u7a0b\u5e8f\u5f00\u53d1\u73af\u5883\uff08OS\/Compiler\/Hardware\uff09\u7684\u5047\u5b9a\u8fdb\u884c\u68c0\u67e5\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u7a0b\u5e8f\u8fd0\u884c\u65f6\u6240\u9700\u7684\u8f6f\u786c\u4ef6\u73af\u5883\u53ca\u914d\u5907\u8981\u6c42\uff0c\u4e0d\u80fd\u7528\u9884\u8a00\u6765\u7a3d\u67e5\uff0c\u800c\u52a1\u5fc5\u7531\u4e00\u6bb5\u4e13\u8bda\u4ee3\u7801\u5904\u7f6e\u3002\u7528\u9884\u8a00\u4ec5\u53ef\u5bf9\u7a0b\u5e8f\u5f00\u53d1\u73af\u5883\u4e2d\u7684\u5047\u60f3\u53ca\u6240\u914d\u5907\u7684\u67d0\u7248\u672c\u8f6f\u786c\u4ef6\u662f\u4e0d\u662f\u5177\u6709\u67d0\u79cd\u6548\u80fd\u7684\u5047\u5b9a\u8fdb\u884c\u68c0\u67e5\u3002\u5982\u67d0\u7f51\u5361\u662f\u4e0d\u662f\u5728\u7cfb\u7edf\u8fd0\u4f5c\u73af\u5883\u4e2d\u914d\u5907\u4e86\uff0c\u5e94\u7531\u7a0b\u5e8f\u4e2d\u6b63\u5f0f\u4ee3\u7801\u6765\u7a3d\u67e5\uff1b\u800c\u6b64\u7f51\u5361\u662f\u4e0d\u662f\u5177\u6709\u67d0\u8bbe\u60f3\u7684\u6548\u80fd\uff0c\u5219\u53ef\u7531\u9884\u8a00\u6765\u68c0\u5bdf\u3002 <\/p>\n
\u5bf9\u7f16\u8bd1\u5668\u63d0\u4f9b\u7684\u6548\u80fd\u53ca\u7279\u70b9\u5047\u60f3\u53ef\u7528\u9884\u8a00\u68c0\u5bdf\uff0c\u539f\u56e0\u662f\u8f6f\u4ef6\u7ec8\u6781\u4ea7\u54c1\uff08\u5373\u8fd0\u4f5c\u4ee3\u7801\u6216\u673a\u5668\u7801\uff09\u4e0e\u7f16\u8bd1\u5668\u5df2\u6ca1\u4efb\u4f55\u76f4\u63a5\u5173\u7cfb\uff0c\u5373\u8f6f\u4ef6\u8fd0\u4f5c\u8fc7\u7a0b\u4e2d\uff08\u6ce8\u610f\u4e0d\u662f\u7f16\u8bd1\u8fc7\u7a0b\u4e2d\uff09\u4e0d\u4f1a\u4e5f\u4e0d\u5e94\u8be5\u5bf9\u7f16\u8bd1\u5668\u7684\u6548\u80fd\u63d0\u62c5\u4efb\u4f55\u9700\u6c42\u3002 <\/p>\n
\u793a\u8303\uff1a\u7528\u9884\u8a00\u7a3d\u67e5\u7f16\u8bd1\u5668\u7684int\u578b\u6570\u636e\u5360\u7528\u7684\u5185\u5b58\u50a8\u5668\u7a7a\u95f4\u662f\u4e0d\u662f\u4e3a\u4e8c\uff0c\u5982\u6b21\u3002 <\/p>\n
EXAM_ASSERT( sizeof( int ) == \u4e8c ); <\/p>\n
\u00b9\u4e03-12\uff1a\u6b63\u5f0f\u8f6f\u4ef6\u4ea7\u54c1\u4e2d\u5e94\u628a\u9884\u8a00\u53ca\u5176\u5b83\u8c03\u6d4b\u4ee3\u7801\u53bb\u6389\uff08\u5373\u628a\u76f8\u5173\u7684\u8c03\u6d4b\u5f00\u5173\u5173\u6389\uff09\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u52a0\u7d27\u8f6f\u4ef6\u8fd0\u4f5c\u901f\u5ea6\u3002 <\/p>\n
\u00b9\u4e03-13\uff1a\u5728\u8f6f\u4ef6\u7cfb\u7edf\u4e2d\u8bbe\u7acb\u4e0e\u64a4\u9664\u76f8\u5e72\u6d4b\u8bd5\u624b\u6bb5\uff0c\u4e0d\u80fd\u5bf9\u8f6f\u4ef6\u5151\u73b0\u7684\u6548\u80fd\u7b49\u4ea7\u751f\u5f71\u54cd\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u5373\u6709\u6d4b\u8bd5\u4ee3\u7801\u7684\u8f6f\u4ef6\u548c\u5173\u6389\u6d4b\u8bd5\u4ee3\u7801\u7684\u8f6f\u4ef6\uff0c\u5728\u6548\u80fd\u4e3e\u52a8\u4e0a\u5e94\u7edf\u4e00\u3002 <\/p>\n
\u00b9\u4e03-14\uff1a\u7528\u8c03\u6d4b\u5f00\u5173\u6765\u5207\u6362\u8f6f\u4ef6\u7684DEBUG\u7248\u548c\u6b63\u5f0f\u7248\uff0c\u800c\u4e0d\u7528\u4e0e\u6b64\u540c\u65f6\u5b58\u5728\u6b63\u5f0f\u7248\u672c\u548cDEBUG\u7248\u672c\u7684\u4e0d\u540c\u6e90\u6587\u4ef6\uff0c\u4ee5\u51cf\u5c0f\u7ef4\u62a4\u7684\u96be\u5ea6\u3002 <\/p>\n
\u00b9\u4e03-15\uff1a\u8f6f\u4ef6\u7684DEBUG\u7248\u672c\u548c\u520a\u884c\u7248\u672c\u5e94\u5f53\u4e00\u81f4\u7ef4\u62a4\uff0c\u4e0d\u5141\u8bb8\u5206\u5bb6\uff0c\u800c\u4e14\u8981\u65f6\u65f6\u6ce8\u610f\u4fdd\u8bc1\u4e66\u4e24\u4e2a\u7248\u672c\u5728\u5151\u73b0\u529f\u80fd\u4e0a\u7684\u4e00\u81f4\u6027\u3002 <\/p>\n
\u00bd\u4e03-\u4e00\uff1a\u5728\u7f16\u7e82\u4ee3\u7801\u9884\u5148\uff0c\u5f53\u5148\u671f\u8bbe\u8ba1\u597d\u7a0b\u5e8f\u8c03\u8bd5\u4e0e\u6d4b\u8bd5\u7684\u6b65\u9aa4\u548c\u624b\u6bb5\uff0c\u5e76\u8bbe\u8ba1\u597d\u5404\u79cd\u8c03\u6d4b\u5f00\u5173\u53ca\u547c\u5e94\u6d4b\u8bd5\u4ee3\u7801\u5982\u6253\u5370\u51fd\u6570\u7b49\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u7a0b\u5e8f\u7684\u8c03\u8bd5\u4e0e\u6d4b\u8bd5\u662f\u8f6f\u4ef6\u751f\u6d3b\u5468\u671f\u4e2d\u5f88\u4e3b\u8981\u7684\u4e00\u4e2a\u9636\u6bb5\uff0c\u4f55\u4ee5\u5bf9\u8f6f\u4ef6\u8fdb\u5c55\u8f83\u5168\u9762\u3001\u9ad8\u7387\u7684\u6d4b\u8bd5\u5e76\u5c3d\u91cf\u5730\u627e\u5230\u8f6f\u4ef6\u4e2d\u7684\u9519\u5904\u5c31\u53d8\u4e3a\u5f88\u8981\u5bb3\u7684\u95ee\u9898\u3002\u56e0\u6b64\u5728\u7f16\u64b0\u6e90\u4ee3\u7801\u9884\u5148\uff0c\u9664\u5f00\u8981\u6709\u4e00\u5957\u6bd4\u8f83\u5b8c\u5584\u7684\u6d4b\u8bd5\u8ba1\u5212\u5916\uff0c\u8fd8\u5e94\u8bbe\u8ba1\u51fa\u4e00\u8fde\u4e32\u4ee3\u7801\u6d4b\u8bd5\u624b\u6bb5\uff0c\u4e3a\u5355\u5143\u6d4b\u8bd5\u3001\u96c6\u6210\u6d4b\u8bd5\u53ca\u7cfb\u7edf\u8054\u8c03\u63d0\u4f9b\u65b9\u4fbf\u3002 <\/p>\n
\u00bd\u4e03-\u4e8c\uff1a\u8c03\u6d4b\u5f00\u5173\u5e94\u5206\u6210\u4e0d\u5e73\u7ea7\u522b\u548c\u95e8\u7c7b\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u8c03\u6d4b\u5f00\u5173\u7684\u8bbe\u7acb\u53ca\u5f52\u7c7b\u5e94\u4ece\u4ee5\u6b21\u51e0\u65b9\u9762\u601d\u5fd6\uff1a\u9488\u5bf9\u6a21\u5757\u6216\u7cfb\u7edf\u67d0\u4e00\u90e8\u5206\u4ee3\u7801\u7684\u8c03\u6d4b\uff1b\u9488\u5bf9\u6a21\u5757\u6216\u7cfb\u7edf\u67d0\u6548\u80fd\u7684\u8c03\u6d4b\uff1b\u9274\u4e8e\u67d0\u79cd\u5176\u5b83\u76ee\u7684\uff0c\u5982\u5bf9\u6027\u80fd\u3001\u5bb9\u91cf\u7b49\u7684\u6d4b\u8bd5\u3002\u8fd9\u4e48\u505a\u6613\u4e8e\u8f6f\u4ef6\u6548\u80fd\u7684\u8c03\u6d4b\uff0c\u800c\u4e14\u6613\u4e8e\u6a21\u5757\u7684\u5355\u5143\u6d4b\u8bd5\u3001\u7cfb\u7edf\u8054\u8c03\u7b49\u3002 <\/p>\n
\u00bd\u4e03-\u4e09\uff1a\u7f16\u7e82\u9632\u9519\u7a0b\u5e8f\uff0c\u5176\u540e\u5728\u5904\u7f6e\u5dee\u9519\u4ee5\u540e\u53ef\u7528\u9884\u8a00\u5ba3\u5e03\u53d1\u4f5c\u9519\u5904\u3002 <\/p>\n
\u793a\u8303\uff1a\u5047\u82e5\u67d0\u6a21\u5757\u6536\u5230\u901a\u8baf\u94fe\u9014\u4e2d\u7684\u8baf\u606f\uff0c\u5219\u5e94\u5bf9\u8baf\u606f\u7684\u5408\u6cd5\u6027\u8fdb\u884c\u68c0\u67e5\uff0c\u82e5\u8baf\u606f\u79cd\u7c7b\u4e0d\u662f\u901a\u4fe1\u534f\u8bae\u4e2d\u89c4\u5b9a\u7684\uff0c\u5219\u5e94\u8fdb\u5c55\u758f\u5931\u5904\u7f6e\uff0c\u4ee5\u540e\u53ef\u7528\u9884\u8a00\u6c47\u62a5\uff0c\u5982\u6b21\u4f8b\u3002 <\/p>\n
#ifdef _EXAM_ASSERT_TEST_ \/\/ \u82e5\u8fd0\u7528\u9884\u8a00\u6d4b\u8bd5 <\/p>\n
\/* Notice: this function does not call 'abort' to exit program *\/ <\/p>\n
void assert_report( char * file_name, unsigned int line_no ) <\/p>\n
{ <\/p>\n
printf( \"\/n[EXAM]Error Report: %s, line %u\/n\", <\/p>\n
file_name, line_no ); <\/p>\n
} <\/p>\n
#define ASSERT_REPORT( condition ) <\/p>\n
if ( condition ) \/\/ \u82e5\u6761\u4ef6\u6210\u7acb\uff0c\u5219\u65e0\u52a8\u4f5c <\/p>\n
NULL; <\/p>\n
else \/\/ \u8981\u4e0d\u7136\u6c47\u62a5 <\/p>\n
assert_report ( __FILE__, __LINE__ ) <\/p>\n
#else \/\/ \u82e5\u4e0d\u8fd0\u7528\u9884\u8a00\u6d4b\u8bd5 <\/p>\n
#define ASSERT_REPORT( condition ) NULL <\/p>\n
#endif \/* end of ASSERT *\/ <\/p>\n
int msg_handle( unsigned char msg_name, unsigned char * msg ) <\/p>\n
{ <\/p>\n
switch( msg_name ) <\/p>\n
{ <\/p>\n
case MSG_ONE: <\/p>\n
... \/\/ \u8baf\u606fMSG_ONE\u5904\u7f6e <\/p>\n
return MSG_HANDLE_SUCCESS; <\/p>\n
... \/\/ \u5176\u5b83\u5408\u6cd5\u8baf\u606f\u5904\u7f6e <\/p>\n
default: <\/p>\n
... \/\/ \u8baf\u606f\u758f\u5931\u5904\u7f6e <\/p>\n
ASSERT_REPORT( FALSE ); \/\/ \u201c\u5408\u6cd5\u201d\u8baf\u606f\u4e0d\u6210\u7acb\uff0c\u6c47\u62a5 <\/p>\n
return MSG_HANDLE_ERROR; <\/p>\n
} <\/p>\n
} <\/p>\n
\u516b \u7a0b\u5e8f\u6548\u7387
\u00b9\u516b-\u4e00\uff1a\u7f16\u7a0b\u65f6\u8981\u5e38\u5e38\u6ce8\u610f\u4ee3\u7801\u7684\u6548\u7387\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u4ee3\u7801\u6548\u7387\u5206\u6210\u5927\u5c40\u6548\u7387\u3001\u5c40\u90e8\u6548\u7387\u3001\u65f6\u95f4\u6548\u7387\u53ca\u7a7a\u95f4\u6548\u7387\u3002\u5927\u5c40\u6548\u7387\u662f\u7ad9\u5728\u6574\u4e2a\u7cfb\u7edf\u7684\u89c6\u89d2\u4e0a\u7684\u7cfb\u7edf\u6548\u7387\uff1b\u5c40\u90e8\u6548\u7387\u662f\u7ad9\u5728\u6a21\u5757\u6216\u51fd\u6570\u89c6\u89d2\u4e0a\u7684\u6548\u7387\uff1b\u65f6\u95f4\u6548\u7387\u662f\u7a0b\u5e8f\u5904\u7f6e\u8f93\u5165\u4efb\u52a1\u6240\u9700\u7684\u65f6\u95f4\u957f\u77ed\uff1b\u7a7a\u95f4\u6548\u7387\u662f\u7a0b\u5e8f\u6240\u9700\u5185\u5b58\u50a8\u5668\u7a7a\u95f4\uff0c\u5982\u673a\u5668\u4ee3\u7801\u7a7a\u95f4\u5927\u5c0f\u3001\u6570\u636e\u7a7a\u95f4\u5927\u5c0f\u3001\u6808\u7a7a\u95f4\u5927\u5c0f\u7b49\u3002 <\/p>\n
\u00b9\u516b-\u4e8c\uff1a\u5728\u4fdd\u8bc1\u4e66\u8f6f\u4ef6\u7cfb\u7edf\u7684\u6b63\u786e\u6027\u3001\u7a33\u5b9a\u6027\u3001\u53ef\u8bfb\u6027\u53ca\u53ef\u6d4b\u6027\u7684\u524d\u63d0\u4e0b\uff0c\u62d4\u9ad8\u4ee3\u7801\u6548\u7387\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u4e0d\u80fd\u4e00\u5473\u5730\u8ffd\u6c42\u4ee3\u7801\u6548\u7387\uff0c\u800c\u5bf9\u8f6f\u4ef6\u7684\u6b63\u786e\u6027\u3001\u7a33\u5b9a\u6027\u3001\u53ef\u8bfb\u6027\u53ca\u53ef\u6d4b\u6027\u4fc3\u6210\u5f71\u54cd\u3002 <\/p>\n
\u00b9\u516b-\u4e09\uff1a\u5c40\u90e8\u6548\u7387\u5e94\u4e3a\u5927\u5c40\u6548\u7387\u670d\u52a1\uff0c\u4e0d\u80fd\u7531\u4e8e\u62d4\u9ad8\u5c40\u90e8\u6548\u7387\u800c\u5bf9\u5927\u5c40\u6548\u7387\u4fc3\u6210\u5f71\u54cd\u3002 <\/p>\n
\u00b9\u516b-\u56db\uff1a\u900f\u8fc7\u5bf9\u7cfb\u7edf\u6570\u636e\u7ed3\u6784\u7684\u533a\u5212\u4e0e\u90e8\u95e8\u7684\u6539\u5584\uff0c\u4ee5\u53ca\u5bf9\u7a0b\u5e8f\u7b97\u6cd5\u7684\u4f18\u5316\u6765\u62d4\u9ad8\u7a7a\u95f4\u6548\u7387\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u8fd9\u79cd\u5f62\u5f0f\u662f\u89e3\u51b3\u8f6f\u4ef6\u7a7a\u95f4\u6548\u7387\u7684\u57fa\u672c\u529e\u6cd5\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u8bb0\u8981\u5b66\u751f\u5b66\u4e60\u6210\u7ee9\u7684\u6784\u9020\u4e0d\u5408\u60c5\u7406\u3002 <\/p>\n
typedef unsigned char BYTE; <\/p>\n
typedef unsigned short WORD; <\/p>\n
typedef struct STUDENT_SCORE_STRU <\/p>\n
BYTE name[\u516b]; <\/p>\n
BYTE age; <\/p>\n
BYTE sex; <\/p>\n
BYTE class; <\/p>\n
BYTE subject; <\/p>\n
float score; <\/p>\n
} STUDENT_SCORE; <\/p>\n
\u7531\u4e8e\u6bcf\u4eba\u5b66\u751f\u90fd\u6709\u591a\u79d1\u5b66\u4e60\u6210\u7ee9\uff0c\u6545\u4e0a\u8ff0\u6784\u9020\u5c06\u5360\u7528\u8f83\u5927\u7a7a\u95f4\u3002\u5f53\u5982\u6b21\u6539\u5584\uff08\u5206\u6210\u4e24\u4e2a\u6784\u9020\uff09\uff0c\u603b\u7684\u8d2e\u5b58\u7a7a\u95f4\u5c06\u53d8\u5c0f\uff0c\u64cd\u4f5c\u4e5f\u53d8\u5f97\u66f4\u4fbf\u5229\u3002 <\/p>\n
typedef struct STUDENT_STRU <\/p>\n
{ <\/p>\n
BYTE name[\u516b]; <\/p>\n
BYTE age; <\/p>\n
BYTE sex; <\/p>\n
BYTE class; <\/p>\n
} STUDENT; <\/p>\n
typedef struct STUDENT_SCORE_STRU <\/p>\n
{ <\/p>\n
WORD student_index; <\/p>\n
BYTE subject; <\/p>\n
float score; <\/p>\n
} STUDENT_SCORE; <\/p>\n
\u00b9\u516b-\u4e94\uff1a\u5faa\u73af\u4f53\u5185\u5de5\u4f5c\u91cf\u6700\u5c0f\u5316\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u5f53\u8ba4\u8ba4\u771f\u771f\u601d\u8003\u5faa\u73af\u4f53\u5185\u7684\u8bdd\u8bed\u662f\u4e0d\u662f\u53ef\u4ee5\u653e\u5728\u5faa\u73af\u4f53\u4ee5\u5916\uff0c\u4f7f\u5faa\u73af\u4f53\u5185\u5de5\u4f5c\u91cf\u6700\u5c0f\uff0c\u6545\u800c\u589e\u9ad8\u7a0b\u5e8f\u7684\u65f6\u95f4\u6548\u7387\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u4ee3\u7801\u6548\u7387\u4e0d\u9ad8\u3002 <\/p>\n
for (ind = \u96f6; ind < MAX_ADD_NUMBER; ind++) <\/p>\n
{ <\/p>\n
sum += ind; <\/p>\n
back_sum = sum; \/* backup sum *\/ <\/p>\n
} <\/p>\n
\u8bdd\u8bed\u201cback_sum = sum;\u201d\u5b8c\u5168\u53ef\u4ee5\u653e\u5728for\u8bdd\u8bed\u4ee5\u540e\uff0c\u5982\u6b21\u3002 <\/p>\n
for (ind = \u96f6; ind < MAX_ADD_NUMBER; ind++) <\/p>\n
{ <\/p>\n
sum += ind; <\/p>\n
} <\/p>\n
back_sum = sum; \/* backup sum *\/ <\/p>\n
\u00bd\u516b-\u4e00\uff1a\u4ed4\u7ec6\u5206\u6790\u76f8\u5173\u7b97\u6cd5\uff0c\u5e76\u5f00\u5c55\u4f18\u5316\u3002 <\/p>\n
\u00bd\u516b-\u4e8c\uff1a\u4ed4\u4ed4\u7ec6\u7ec6\u89c6\u5bdf\u3001\u5206\u6790\u7cfb\u7edf\u53ca\u6a21\u5757\u5904\u7f6e\u8f93\u5165\uff08\u5982\u4e8b\u5b9c\u3001\u8baf\u606f\u7b49\uff09\u7684\u5f62\u5f0f\uff0c\u5e76\u52a0\u4ee5\u6539\u8fdb\u3002 <\/p>\n
\u00bd\u516b-\u4e09\uff1a\u5bf9\u6a21\u5757\u4e2d\u51fd\u6570\u7684\u533a\u5212\u53ca\u673a\u5173\u6a21\u5f0f\u5f00\u5c55\u5206\u6790\u3001\u4f18\u5316\uff0c\u6539\u5584\u6a21\u5757\u4e2d\u51fd\u6570\u7684\u673a\u6784\u6784\u9020\uff0c\u589e\u9ad8\u7a0b\u5e8f\u6548\u7387\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u8f6f\u4ef6\u7cfb\u7edf\u7684\u6548\u7387\u91cd\u8981\u4e0e\u7b97\u6cd5\u3001\u5904\u7f6e\u4efb\u52a1\u5f62\u5f0f\u3001\u7cfb\u7edf\u6548\u80fd\u53ca\u51fd\u6570\u6784\u9020\u6709\u5f88\u5927\u5173\u7cfb\uff0c\u4ec5\u5728\u4ee3\u7801\u5de6\u53f3\u529f\u592b\u6b63\u5e38\u4e0d\u80fd\u89e3\u51b3\u6839\u672c\u95ee\u9898\u3002 <\/p>\n
\u00bd\u516b-\u56db\uff1a\u7f16\u7a0b\u65f6\uff0c\u8981\u65f6\u523b\u7559\u610f\u4ee3\u7801\u6548\u7387\uff1b\u4f18\u5316\u4ee3\u7801\u65f6\uff0c\u8981\u601d\u5fd6\u5468\u5230\u3002 <\/p>\n
\u00bd\u516b-\u4e94\uff1a\u4e0d\u5e94\u82b1\u8fc7\u5269\u7684\u65f6\u95f4\u73a9\u513f\u547d\u5730\u589e\u9ad8\u8c03\u7528\u4e0d\u5f88\u9891\u7e41\u7684\u51fd\u6570\u4ee3\u7801\u6548\u7387\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u5bf9\u4ee3\u7801\u4f18\u5316\u53ef\u63d0\u9ad8\u6548\u7387\uff0c\u4f46\u82e5\u8003\u8651\u4e0d\u5468\u5f88\u6709\u4e5f\u8bb8\u5524\u8d77\u4e25\u91cd\u540e\u679c\u3002 <\/p>\n
\u00bd\u516b-\u516d\uff1a\u8981\u4ed4\u4ed4\u7ec6\u7ec6\u5730\u7ed3\u6784\u6216\u76f4\u63a5\u7528\u6c47\u7f16\u7f16\u64b0\u8c03\u7528\u9891\u7e41\u6216\u6027\u80fd\u8981\u6c42\u6781\u9ad8\u7684\u51fd\u6570\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u60df\u72ec\u5bf9\u7f16\u8bd1\u7cfb\u7edf\u53d1\u4f5c\u673a\u5668\u7801\u7684\u6a21\u5f0f\u4ee5\u53ca\u786c\u4ef6\u7cfb\u7edf\u8f83\u4e3a\u719f\u4e60\u65f6\uff0c\u624d\u53ef\u8fd0\u7528\u6c47\u7f16\u5d4c\u5165\u5f62\u5f0f\u3002\u5d4c\u5165\u6c47\u7f16\u53ef\u62d4\u9ad8\u65f6\u95f4\u53ca\u7a7a\u95f4\u6548\u7387\uff0c\u4f46\u4e5f\u5b58\u5728\u4e00\u5b9a\u5371\u9669\u3002 <\/p>\n
\u00bd\u516b-\u4e03\uff1a\u5728\u4fdd\u8bc1\u4e66\u7a0b\u5e8f\u54c1\u8d28\u7684\u524d\u63d0\u4e0b\uff0c\u7ecf\u8fc7\u538b\u7f29\u4ee3\u7801\u91cf\u3001\u53bb\u6389\u7528\u4e0d\u7740\u4ee3\u7801\u4ee5\u53ca\u51cf\u5c0f\u7528\u4e0d\u7740\u7684\u5c40\u90e8\u548c\u5168\u5c40\u53d8\u91cf\uff0c\u6765\u62d4\u9ad8\u7a7a\u95f4\u6548\u7387\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u8fd9\u79cd\u5f62\u5f0f\u5bf9\u62d4\u9ad8\u7a7a\u95f4\u6548\u7387\u53ef\u8d77\u5230\u4e00\u5b9a\u529f\u7528\uff0c\u4f46\u5f80\u5f80\u4e0d\u80fd\u89e3\u51b3\u6839\u672c\u95ee\u9898\u3002 <\/p>\n
\u00bd\u516b-\u516b\uff1a\u5728\u591a\u91cd\u5faa\u73af\u4e2d\uff0c\u5e94\u5c06\u6700\u5fd9\u7684\u5faa\u73af\u653e\u5728\u6700\u5185\u5c42\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u51cf\u5c0fCPU\u5207\u5165\u5faa\u73af\u5c42\u7684\u6b21\u6570\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u4ee3\u7801\u6548\u7387\u4e0d\u9ad8\u3002 <\/p>\n
for (row = \u96f6; row < 100; row++) <\/p>\n
{ <\/p>\n
for (col = \u96f6; col < \u4e94; col++) <\/p>\n
{ <\/p>\n
sum += a[row][col]; <\/p>\n
} <\/p>\n
} <\/p>\n
\u53ef\u4ee5\u6539\u6210\u5982\u6b21\u6a21\u5f0f\uff0c\u4ee5\u63d0\u9ad8\u6548\u7387\u3002 <\/p>\n
for (col = \u96f6; col < \u4e94; col++) <\/p>\n
{ <\/p>\n
for (row = \u96f6; row < 100; row++) <\/p>\n
{ <\/p>\n
sum += a[row][col]; <\/p>\n
} <\/p>\n
} <\/p>\n
\u00bd\u516b-\u4e5d\uff1a\u5c3d\u53ef\u80fd\u51cf\u5c0f\u5faa\u73af\u5d4c\u5957\u5c42\u6b21\u3002 <\/p>\n
\u00bd\u516b-\u5341\uff1a\u907f\u514d\u5faa\u73af\u4f53\u5185\u542b\u5224\u5224\u6848\u53e5\uff0c\u5e94\u5c06\u5faa\u73af\u8bdd\u8bed\u7f6e\u4e8e\u5224\u65ad\u6848\u53e5\u7684\u4ee3\u7801\u5757\u4e4b\u4e2d\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u76ee\u7684\u662f\u51cf\u5c0f\u5224\u65ad\u6b21\u6570\u3002\u5faa\u73af\u4f53\u4e2d\u7684\u5224\u65ad\u6848\u53e5\u662f\u4e0d\u662f\u53ef\u4ee5\u79fb\u5230\u5faa\u73af\u4f53\u5916\uff0c\u8981\u77a7\u7a0b\u5e8f\u7684\u5177\u4f53\u60c5\u51b5\u800c\u8c08\uff0c\u6b63\u5e38\u666f\u51b5\uff0c\u4e0e\u5faa\u73af\u53d8\u91cf\u65e0\u5e72\u7684\u5224\u65ad\u6848\u53e5\u53ef\u4ee5\u79fb\u5230\u5faa\u73af\u4f53\u5916\uff0c\u800c\u76f8\u5e72\u7684\u5219\u4e0d\u53ef\u4ee5\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u4ee3\u7801\u6548\u7387\u7a0d\u4f4e\u3002 <\/p>\n
for (ind = \u96f6; ind < MAX_RECT_NUMBER; ind++) <\/p>\n
{ <\/p>\n
if (data_type == RECT_AREA) <\/p>\n
{ <\/p>\n
area_sum += rect_area[ind]; <\/p>\n
} <\/p>\n
else <\/p>\n
{ <\/p>\n
rect_length_sum += rect[ind].length; <\/p>\n
rect_width_sum += rect[ind].width; <\/p>\n
} <\/p>\n
} <\/p>\n
\u7531\u4e8e\u5224\u5224\u6848\u53e5\u4e0e\u5faa\u73af\u53d8\u91cf\u65e0\u5e72\uff0c\u6545\u53ef\u5982\u6b21\u6539\u5584\uff0c\u4ee5\u51cf\u5c0f\u5224\u65ad\u6b21\u6570\u3002 <\/p>\n
if (data_type == RECT_AREA) <\/p>\n
{ <\/p>\n
for (ind = \u96f6; ind < MAX_RECT_NUMBER; ind++) <\/p>\n
{ <\/p>\n
area_sum += rect_area[ind]; <\/p>\n
} <\/p>\n
} <\/p>\n
else <\/p>\n
{ <\/p>\n
for (ind = \u96f6; ind < MAX_RECT_NUMBER; ind++) <\/p>\n
{ <\/p>\n
rect_length_sum += rect[ind].length; <\/p>\n
rect_width_sum += rect[ind].width; <\/p>\n
} <\/p>\n
} <\/p>\n
\u00bd\u516b-11\uff1a\u5c3d\u53ef\u80fd\u7528\u4e58\u6cd5\u6216\u5176\u5b83\u6b65\u9aa4\u66ff\u4ee3\u9664\u6cd5\uff0c\u7279\u522b\u662f\u6d6e\u70b9\u6f14\u7b97\u4e2d\u7684\u9664\u6cd5\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u6d6e\u70b9\u6f14\u7b97\u9664\u6cd5\u8981\u5360\u7528\u8f83\u591aCPU\u8d44\u6e90\u3002 <\/p>\n
\u793a\u8303\uff1a\u5982\u6b21\u8868\u8fbe\u5f0f\u6f14\u7b97\u53ef\u80fd\u8981\u5360\u8f83\u591aCPU\u8d44\u6e90\u3002 <\/p>\n
#define PAI 3.1416 <\/p>\n
radius = circle_length \/ (\u4e8c * PAI); <\/p>\n
\u5f53\u5982\u6b21\u628a\u6d6e\u70b9\u9664\u6cd5\u6539\u6210\u6d6e\u70b9\u4e58\u6cd5\u3002 <\/p>\n
#define PAI_RECIPROCAL (\u4e00 \/ 3.1416 ) \/\/ \u7f16\u8bd1\u5668\u7f16\u8bd1\u65f6\uff0c\u5c06\u751f\u6210\u5177\u4f53\u6d6e\u70b9\u6570 <\/p>\n
radius = circle_length * PAI_RECIPROCAL \/ \u4e8c; <\/p>\n
\u00bd\u516b-12\uff1a\u4e0d\u7528\u4e00\u5473\u8ffd\u6c42\u7d27\u51d1\u7684\u4ee3\u7801\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u7531\u4e8e\u7d27\u51d1\u7684\u4ee3\u7801\u5e76\u4e0d\u4ee3\u8868\u9ad8\u6548\u7387\u7684\u673a\u5668\u7801\u3002 <\/p>\n
\u4e5d \u8d28\u91cf\u4fdd\u8bc1
\u00b9\u4e5d-\u4e00\uff1a\u5728\u8f6f\u4ef6\u8bbe\u8ba1\u8fc7\u7a0b\u4e2d\u6784\u7b51\u8f6f\u4ef6\u54c1\u8d28\u3002 <\/p>\n
\u00b9\u4e5d-\u4e8c\uff1a\u4ee3\u7801\u8d28\u91cf\u4fdd\u8bc1\u4f18\u5148\u51c6\u5219 <\/p>\n
\uff08\u4e00\uff09\u6b63\u786e\u6027\uff0c\u6307\u7a0b\u5e8f\u8981\u5151\u73b0\u8bbe\u8ba1\u8981\u6c42\u7684\u6548\u80fd\u3002 <\/p>\n
\uff08\u4e8c\uff09\u7a33\u5b9a\u6027\u3001\u5b89\u5168\u6027\uff0c\u6307\u7a0b\u5e8f\u7a33\u56fa\u3001\u9760\u5f97\u4f4f\u3001\u4fdd\u9669\u3002 <\/p>\n
\uff08\u4e09\uff09\u53ef\u6d4b\u8bd5\u6027\uff0c\u6307\u7a0b\u5e8f\u8981\u5177\u6709\u5f88\u597d\u7684\u53ef\u6d4b\u8bd5\u6027\u3002 <\/p>\n
\uff08\u56db\uff09\u8f68\u8303\/\u53ef\u8bfb\u6027\uff0c\u6307\u7a0b\u5e8f\u4e66\u5199\u4f5c\u6d3e\u3001\u5b9a\u540d\u5b88\u5219\u7b49\u8981\u5951\u5408\u8f68\u8303\u3002 <\/p>\n
\uff08\u4e94\uff09\u5927\u5c40\u6548\u7387\uff0c\u6307\u8f6f\u4ef6\u7cfb\u7edf\u7684\u901a\u4f53\u6548\u7387\u3002 <\/p>\n
\uff08\u516d\uff09\u5c40\u90e8\u6548\u7387\uff0c\u6307\u67d0\u4e2a\u6a21\u5757\/\u5b50\u6a21\u5757\/\u51fd\u6570\u7684\u81ea\u8eab\u6548\u7387\u3002 <\/p>\n
\uff08\u4e03\uff09\u4e2a\u4eba\u8868\u8fbe\u65b9\u5f0f\/\u4e2a\u4eba\u65b9\u4fbf\u6027\uff0c\u6307\u4e2a\u4eba\u7f16\u7a0b\u4e60\u6c14\u3002 <\/p>\n
\u00b9\u4e5d-\u4e09\uff1a\u53ea\u5f15\u8ff0\u5c5e\u4e8e\u81ea\u4e2a\u513f\u7684\u8d2e\u5b58\u7a7a\u95f4\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u82e5\u6a21\u5757\u6253\u5305\u7684\u8f83\u597d\uff0c\u90a3\u4e48\u6b63\u5e38\u4e0d\u4f1a\u53d1\u4f5c\u975e\u6cd5\u6458\u5f15\u65c1\u4eba\u7684\u7a7a\u95f4\u3002 <\/p>\n
\u00b9\u4e5d-\u56db\uff1a\u9632\u6b62\u6458\u5f15\u5df2\u7ecf\u5f00\u91ca\u7684\u5185\u5b58\u50a8\u5668\u7a7a\u95f4\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u5728\u73b0\u5b9e\u7f16\u7a0b\u8fc7\u7a0b\u4e2d\uff0c\u7a0d\u4e0d\u7559\u5fc3\u5c31\u4f1a\u51fa\u73b0\u5728\u4e00\u4e2a\u6a21\u5757\u4e2d\u5f00\u91ca\u4e86\u67d0\u4e2a\u5185\u5b58\u50a8\u5668\u5757\uff08\u5982C\u8bed\u8a00\u6307\u9488\uff09\uff0c\u800c\u53e6\u4e00\u6a21\u5757\u5728\u8fc7\u540e\u7684\u67d0\u4e2a\u65f6\u65f6\u53c8\u65bd\u7528\u4e86\u5b83\u3002\u8981\u9632\u6b62\u8fd9\u79cd\u72b6\u51b5\u4ea7\u751f\u3002 <\/p>\n
\u00b9\u4e5d-\u4e94\uff1a\u8fdb\u7a0b\/\u51fd\u6570\u4e2d\u5206\u914d\u7684\u5185\u5b58\u50a8\u5668\uff0c\u5728\u8fdb\u7a0b\/\u51fd\u6570\u9000\u51fa\u5934\u91cc\u8981\u5f00\u91ca\u3002 <\/p>\n
\u00b9\u4e5d-\u516d\uff1a\u5386\u7a0b\/\u51fd\u6570\u4e2d\u7533\u8bf7\u7684\uff08\u4e3a\u6253\u5f00\u8d44\u6599\u800c\u8fd0\u7528\u7684\uff09\u8d44\u6599\u53e5\u67c4\uff0c\u5728\u5386\u7a0b\/\u51fd\u6570\u9000\u51fa\u9884\u5148\u8981\u5c01\u95ed\u3002 <\/p>\n
\u8bf4\u660e\uff1a\u5206\u914d\u7684\u5185\u5b58\u50a8\u5668\u4e0d\u5f00\u91ca\u4ee5\u53ca\u8d44\u6599\u53e5\u67c4\u4e0d\u5c01\u9501\uff0c\u662f\u8f83\u6bd4\u5e38\u89c1\u7684\u5dee\u9519\uff0c\u5e76\u4e14\u7a0d\u4e0d\u6ce8\u610f\u5c31\u6709\u53ef\u80fd\u53d1\u751f\u3002\u8fd9\u7c7b\u5dee\u9519\u5f80\u5f80\u4f1a\u5f15\u8d77\u5f88\u4e25\u91cd\u540e\u679c\uff0c\u4e14\u96be\u4ee5\u5b9a\u4f4d\u3002 <\/p>\n
\u793a\u8303\uff1a\u505c\u51fd\u6570\u5728\u9000\u51fa\u4e8b\u524d\uff0c\u6ca1\u628a\u5206\u914d\u7684\u5185\u5b58\u50a8\u5668\u5f00\u91ca\u3002 <\/p>\n
typedef unsigned char BYTE; <\/p>\n
int example_fun( BYTE gt_len, BYTE *gt_code ) <\/p>\n
{ <\/p>\n
BYTE *gt_buf; <\/p>\n
gt_buf = (BYTE *) malloc (MAX_GT_LENGTH); <\/p>\n
... \/\/program code, include check gt_buf if or not NULL. <\/p>\n
\/* global title length error *\/ <\/p>\n
if (gt_len > MAX_GT_LENGTH) <\/p>\n
{ <\/p>\n
retur <\/p>\n
\u672c\u6587\u6765\u6e90\uff1a
\u6211\u7684\u5f02\u5e38\u7f51
Java Exception
Dotnet Exception
Oracle Exception<\/p>\n
<\/p>\n
<\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"\u534e\u4e3a\u8f6f\u4ef6\u7f16\u7a0b\u8f68\u8303\u548c\u5b9e\u4f8b\u534e\u4e3a\u8f6f\u4ef6\u7f16\u7a0b\u8f68\u8303\u548c\u5b9e\u4f8b\u76ee\u5f55\u4e00\u6392\u5b57\u516d\u4e8c\u8be0\u91ca11\u4e09\u6807\u8bc6\u7b26\u5b9a\u540d18\u56db\u53ef\u8bfb\u602720\u4e94\u53d8\u91cf\u3001\u6784\u902022\u516d\u51fd\u6570\u3001\u8fdb\u7a0b28...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/4699"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=4699"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/4699\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=4699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=4699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=4699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}