XCODE3 怎麼啦? 有請高手指點!

Mac 軟體使用經驗交流專區

版主: Alex Tsaiross_ttdigdog

回覆文章
內容
發表人
頭像
rlong
嗜冰客
文章: 1530
註冊時間: 04/30/2001 1:01 am
來自: 新竹
聯繫:

XCODE3 怎麼啦? 有請高手指點!

#1 文章 rlong »

http://homepage.mac.com/rlong4587/.Publ ... /testx.zip

一個程式,在XCODE3 debug/release mode下分別編譯成執行檔,

然後在 PPC Mac 及 intel Mac 下執行,就會產生四種不同的結果:

“ 難道是我錯了嗎?“ :evil:

00EF04

A30004

00EF00

00040000EF00

:? :? :?

{ unsigned char i; int j; char k;
char s[]="A3EF04";
sscanf(s,"%2X%2x%2x",&i,&j,&k);
[text setStringValue:[NSString stringWithFormat:@"%02X%02X%02X",i,j,k]];
}
I love OPERA !
頭像
the real unknown
冰果室打手
文章: 2610
註冊時間: 04/26/2001 1:01 am
來自: GMT-5
聯繫:

#2 文章 the real unknown »

http://developer.apple.com/documentatio ... anf.3.html

x 和 X 只能用在 unsigned int 上。
Eat well. Exercise. And die anyway.
頭像
rlong
嗜冰客
文章: 1530
註冊時間: 04/30/2001 1:01 am
來自: 新竹
聯繫:

#3 文章 rlong »

the real unknown 寫:http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/sscanf.3.html

x 和 X 只能用在 unsigned int 上。
多謝! :)

也就是說,寫程式不嚴守規矩,我亂寫,他就亂做了 :D
I love OPERA !
回覆文章