補數,程式設計的參數"~" - 考試
By Kumar
at 2013-06-10T16:24
at 2013-06-10T16:24
Table of Contents
版大抱歉,這個單純是個程式的疑問,但不知道該歸類到哪個標題...
-----------------------------------------
程式設計有個參數是"~", ex. int a=5 ; ~a
查過用意是代表該數的1的補數
但小弟用VC2005去跑,
int a=5 ;
int d=~a ;
d會一直跑出-6 ,
請問這個-6是怎麼算出來的呢?
---------------------------------------
小弟以為....
5的2進位為0101
2's 為 011
1's 為 010
請大大幫忙解惑
感謝~~~
--
-----------------------------------------
程式設計有個參數是"~", ex. int a=5 ; ~a
查過用意是代表該數的1的補數
但小弟用VC2005去跑,
int a=5 ;
int d=~a ;
d會一直跑出-6 ,
請問這個-6是怎麼算出來的呢?
---------------------------------------
小弟以為....
5的2進位為0101
2's 為 011
1's 為 010
請大大幫忙解惑
感謝~~~
--
Tags:
考試
All Comments
By Irma
at 2013-06-14T23:24
at 2013-06-14T23:24
By Emma
at 2013-06-15T13:39
at 2013-06-15T13:39
By Daniel
at 2013-06-19T01:53
at 2013-06-19T01:53
By Regina
at 2013-06-20T17:42
at 2013-06-20T17:42
By Cara
at 2013-06-24T13:02
at 2013-06-24T13:02
By Robert
at 2013-06-27T19:50
at 2013-06-27T19:50
By Gilbert
at 2013-06-30T18:45
at 2013-06-30T18:45
By Rebecca
at 2013-07-02T20:22
at 2013-07-02T20:22
By Cara
at 2013-07-03T23:31
at 2013-07-03T23:31
Related Posts
資管系畢老頭該報考那類科?
By Anonymous
at 2013-06-10T16:07
at 2013-06-10T16:07
102初考 基本電學
By Victoria
at 2013-06-10T15:41
at 2013-06-10T15:41
請問義大公佈的答案疑義
By Hedda
at 2013-06-10T15:17
at 2013-06-10T15:17
新北市102年公立幼兒園契約進用職員簡章
By Jacob
at 2013-06-10T14:43
at 2013-06-10T14:43
電腦網路兩個流量控制的問題
By Valerie
at 2013-06-10T13:32
at 2013-06-10T13:32