1 頁 (共 1 頁)

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

發表於 : 05/02/2008 6:22 pm
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]];
}

發表於 : 05/02/2008 11:03 pm
the real unknown
http://developer.apple.com/documentatio ... anf.3.html

x 和 X 只能用在 unsigned int 上。

發表於 : 05/03/2008 6:49 am
rlong
the real unknown 寫:http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/sscanf.3.html

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

也就是說,寫程式不嚴守規矩,我亂寫,他就亂做了 :D