• slider image 514
  • slider image 516
  • slider image 517
  • slider image 518
  • slider image 519
:::


Browsing this Thread:   1 Anonymous Users






Re: 一些關於C編寫上的問題
#2
新會員
新會員


查看用戶資訊
1. 這是conditional compilation, 有條件的編譯
如果在這些程式之前出現
#define DLL_BUILD
的指令的話,在#ifndef ..... #endif之間的程式,才會成為程式的一部分,否則會被略過.
2. 你的程式是CCS的程式,int8 是CCS預設的資料格式,如果不用CCS compiler,哪就要自行宣告,類似
#ifndef _CCS // 是否是_CCS還要查一下書
typedef unsigned char int8
#endif

其餘的都是CCS的特定指令


發表於: 2006/11/5 22:45
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


一些關於C編寫上的問題
#1
高級會員
高級會員


查看用戶資訊
請問各位先進,最近在學習撰寫c上遇上了一些疑惑想請各位先進幫忙解答,以下是我在閱讀別人寫的程式中不懂的問題
1.請問#ifndef 代表為何??
#ifndef DLL_BUILD
typedef unsigned int8 Uint8;
#else
typedef unsigned char Uint8;
我在使用c編輯器時,編輯器無法認出int8代表的是什麼,而且會出現錯誤,是因為編輯器無法辨別int8嗎?但是這個程式已經有一個組譯過的檔案,所以應該程式本身是沒有錯誤的。

2.#CASE、
#USE fast_io(b)、
#rom CPC_EEP_STR =
{
5, 5, 5, 4, //VCO 1
4, 6, 6, 5, //VCO 2
5, 5, 7, 6, //VCO 3
6, 6, 5, 8, //VCO 4
7, 7, 6, 6, //VCO 5
8, 7, 7, 6, //VCO 1
6, 9, 8, 8, //VCO 2
7, 7, 10, 9, //VCO 3
9, 8, 7, 11, //VCO 4
10, 10, 9, 8 //VCO 5
}、
#INT_EXT、#INT_DEFAULT、#INT_TIMER1、#INT_RTCC
#separate void set_input_path(Uint8 bank);
以上命令所代表的是什麼意思,在c編輯器中#後面的字串由紅色來表示又代表示什麼意思。
3.WIN32DLL_API void _stdcall stop_process(void);
此行的動作為何???

請各位先進能幫忙指導,謝謝。


發表於: 2006/9/4 16:00
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------