Browsing this Thread:
1 Anonymous Users
|
請問一個 C 的 printf 語法
|
|
高級會員
Joined
: 2008/8/8 12:05 最後登入時間
: 2014/5/14 19:11
Group:
註冊會員
Level : 8 HP : 0 / 194 MP : 32 / 8954 EXP : 78
|
硬體敘訴: a : LAN Module,LAN收到的資料由Chip本身的 Uart_TX 丟出來, 換句話說,這顆 Chip 左邊由LAN收資料進來右邊由Com把資料丟 出去 b : 我的 PIC,我的PIC的RX去接收 LAN 的 TX,收進來放在我開的陣 列裡面,然後再把陣列裡面的資料"原封不動"的再 printf 出去給 另外一邊的 GSM Module
Notice : 這都是 machine tx to machine rx,不經過 max232 我想問的重點是 printf 語法上 應用在 CCS 裡面 (暫且不論IC各家的組譯器),我想把 Array 裡面的東西原封不動的丟出來以下哪個是正確的 ?
下面哪個正確 ?
for( i=0 ; i <xxx ; i++ ) { printf(array[i]); <--- 都不加 printf( "%c", array[i]); <---%c 印字元 printf( "%d", array[i]); <---%d 印數字 printf( "%s", array[i]); <---%s 印String or character
等 %w %x %各種型別轉換 }
Notice:請站在 machine tx to machine 的角度 用終端機或者 Dev C 去看,都是螢幕上為了讓人眼 去看所以看到的會是符號亂碼,這我是知道的,我想 我問的是個蠻概念的東西 @@,最主要是要將收到的 資料"原封不動 pass 過去給另一邊,用 printf 的方式
發表於: 2009/9/18 10:52
|
|
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.