Discussion:
Ô­ÀŽ»¹ÄÜÕâÑùÔö³€±äÁ¿×֜ڹþ¡«¡«¡«
(时间太久无法回复)
tyh_123
2009-10-19 05:51:07 UTC
Permalink
unsigned long long a;
unsigned long b;

aÊÇbµÄ2±¶¡£¡£¡£¡£¡£¡£³€ŒûʶÁË¡£¡£¡£¡£
acc
2009-10-19 07:09:14 UTC
Permalink
long long ÊÇžö¹ØŒü×Ö°¡

ÄãŪžö int int ÊÔÊÔ
Post by tyh_123
unsigned long long a;
unsigned long b;
aÊÇbµÄ2±¶¡£¡£¡£¡£¡£¡£³€ŒûʶÁË¡£¡£¡£¡£
tyh_123
2009-10-19 07:16:10 UTC
Permalink
ÎÒŽíÁË¡£¡£¡£¡£

µÄÈ·long longÊÇÒ»Õûžö¹ØŒü×Ö.ÄÜ˵˵long long²»£¿
Post by acc
long long ÊÇžö¹ØŒü×Ö°¡
ÄãŪžö int int ÊÔÊÔ
Post by tyh_123
unsigned long long a;
unsigned long b;
aÊÇbµÄ2±¶¡£¡£¡£¡£¡£¡£³€ŒûʶÁË¡£¡£¡£¡£
acc
2009-10-19 08:17:07 UTC
Permalink
long long ÎÒ˵²»ºÃ¡£ÎÒûÓÐÓùý 16 λµÄ int¡£ÔÚ 32 λ cpu µÄ»úÆ÷ÉÏ£¬int ÊÇ 32
룬long long ÊÇ 64 λ¡£

64 λ±È 32 λ³€£¬Ê¹ÓÃÒÆλ²Ù×÷µÄʱºò£¬ËüÒƵĞüÔ¶£»ÊýÖµŒÆËãʱ£¬ËüÔÚÒç³ö֮ǰŒá³ÖµÄžüŸÃ¡£Ò»žö»ù±ŸÊýŸÝÀàÐÍ£¬ÆäʵÎÞ·ÇÊÇÖž³ö£º
1. ÕâžöÊýŸÝÕŒ¶à³€¡£
2. ÄÜÔÚÕâÒ»¶ÎλÉÏÊ©ŒÓºÎÖÖ²Ù×÷¡£

windows Ò²ÓÐһЩ 64 λµÄÊýŸÝ£¬Ò»°ãÓñàÒëÆ÷¹ØŒü×Ö __int64£¬·ûºÅ³£Á¿±ÈÈç
LONG64¡¢LONG_PTR£šÌõŒþ±àÒ룬ÓÐʱºòÊÇ int£¬ÓÐʱºòÊÇ __int64£©¡£long long ÊÇCÓïÑÔ±ê׌¹æ¶šµÄ¹ØŒü×Ö¡£

long long ÕâžöÃû×Ö˵Ã÷Ëü²»ÊÇ int¡£œ«ÀŽÊ¹Óà 64 λ cpu µÄʱºò£¬²»ÖªµÀ int ³€¶ÈÊǶàÉÙ£¬ÖžÕë³€¶ÈÓÖÊǶàÉÙ¡££šWindows ºËÐıà³Ì£¬µÚÎå°æ ºÃÏñœ²µœÁËÕâÁ©ÎÊÌ⣩

====================================================

²»Ÿ­Òâ¿Žµœ£¬Ô­ÀŽÄãÒ²¡°ÒÑŸ­ÒÔʵŒÊÐж¯ÏìÓŠbuzzardµÄºÅÕÙ¡±ÁË¡£ÐÂÎÅ×éÓÉŽóŒÒŸö²ß£¬ÄÇÃŽÏÖÔÚÎҟ͞ıäÖ÷Òâ¡£¹§ŸŽ²»ÈçŽÓÃü£¬ÒÔºóÎÒÒ²¹ã²¥¡£
Post by tyh_123
ÎÒŽíÁË¡£¡£¡£¡£
µÄÈ·long longÊÇÒ»Õûžö¹ØŒü×Ö.ÄÜ˵˵long long²»£¿
tyh_123
2009-10-19 08:27:05 UTC
Permalink
1£¬ÎªÉ¶²»ÓÃlong longºÍlong±ÈœÏ£¿
2£¬int²»ÊǺͱàÒëÆ÷ÓйØÃŽ£¿Ã»×¢ÒâintÊǶàÉÙ£¬ÏÂŽÎdebugµÄʱºò¿Ž¿Ž¡£
3£¬»·Ÿ³Î¬»€¿¿ŽóŒÒ¡£¡£¡£¡£Õâµã³ÌÐòÔ±µÄÒâËŒÓÈΪÇå³þ¹þ¡«¡«¡«
Post by acc
long long ÎÒ˵²»ºÃ¡£ÎÒûÓÐÓùý 16 λµÄ int¡£ÔÚ 32 λ cpu µÄ»úÆ÷ÉÏ£¬int ÊÇ
32 룬long long ÊÇ 64 λ¡£
64 λ±È 32 λ³€£¬Ê¹ÓÃÒÆλ²Ù×÷µÄʱºò£¬ËüÒƵĞüÔ¶£»ÊýÖµŒÆËãʱ£¬ËüÔÚÒç³ö֮ǰŒá³ÖµÄžüŸÃ¡£Ò»žö»ù±ŸÊýŸÝÀàÐÍ£¬ÆäʵÎÞ·ÇÊÇÖž³ö£º
1. ÕâžöÊýŸÝÕŒ¶à³€¡£
2. ÄÜÔÚÕâÒ»¶ÎλÉÏÊ©ŒÓºÎÖÖ²Ù×÷¡£
windows Ò²ÓÐһЩ 64 λµÄÊýŸÝ£¬Ò»°ãÓñàÒëÆ÷¹ØŒü×Ö __int64£¬·ûºÅ³£Á¿±ÈÈç
LONG64¡¢LONG_PTR£šÌõŒþ±àÒ룬ÓÐʱºòÊÇ int£¬ÓÐʱºòÊÇ __int64£©¡£long long ÊÇCÓïÑÔ±ê׌¹æ¶šµÄ¹ØŒü×Ö¡£
long long ÕâžöÃû×Ö˵Ã÷Ëü²»ÊÇ int¡£œ«ÀŽÊ¹Óà 64 λ cpu µÄʱºò£¬²»ÖªµÀ int ³€¶ÈÊǶàÉÙ£¬ÖžÕë³€¶ÈÓÖÊǶàÉÙ¡££šWindows ºËÐıà³Ì£¬µÚÎå°æ ºÃÏñœ²µœÁËÕâÁ©ÎÊÌ⣩
====================================================
²»Ÿ­Òâ¿Žµœ£¬Ô­ÀŽÄãÒ²¡°ÒÑŸ­ÒÔʵŒÊÐж¯ÏìÓŠbuzzardµÄºÅÕÙ¡±ÁË¡£ÐÂÎÅ×éÓÉŽóŒÒŸö²ß£¬ÄÇÃŽÏÖÔÚÎҟ͞ıäÖ÷Òâ¡£¹§ŸŽ²»ÈçŽÓÃü£¬ÒÔºóÎÒÒ²¹ã²¥¡£
Post by tyh_123
ÎÒŽíÁË¡£¡£¡£¡£
µÄÈ·long longÊÇÒ»Õûžö¹ØŒü×Ö.ÄÜ˵˵long long²»£¿
acc
2009-10-19 08:43:29 UTC
Permalink
Post by tyh_123
1£¬ÎªÉ¶²»ÓÃlong longºÍlong±ÈœÏ£¿
ÎÒ˵¹ýÒ»žö»ù±ŸÊýŸÝÀàÐÍ£¬ÆäʵÎÞ·ÇÊÇÖž³ö£º
1. ÕâžöÊýŸÝÕŒ¶à³€¡£
2. ÄÜÔÚÕâÒ»¶ÎλÉÏÊ©ŒÓºÎÖÖ²Ù×÷¡£

ÎÒžÕ²ÅÄà long long ºÍ int ±ÈœÏ£¬ÄãÒ²¿ÉÒÔ»»³ÉºÍ long ±ÈœÏ£¬»òÕßºÍ char ±ÈœÏ¡£ËüÃÇÖ®Œä³ýÁ˳€¶È£¬ÆäÓà²î±ðºÜС¡£C++ÓÐÁœÖÖ»ù±ŸÀàÐÍ£ºÕûÐÍ£¬ž¡µãÐÍ¡£ÆäÓàÊÇžŽºÏÀàÐÍÈçÖžÕë¡¢Êý×é¡¢Óû§×Ô¶šÒåÀàÐÍ£šÀàÀàÐÍ£©¡£

long ŸÍÊÇ long int
int ŸÍÊÇ int
short ŸÍÊÇ short int
char ŸÍÊÇÒ»×ÖœÚµÄ int£¬Ã»ÓС°char int¡±ÕâÖÖÐŽ·š¡£ÁíÍâ char ûÓÐĬÈϵķûºÅ׎̬£¬Žø»òÕß²»Žø·ûºÅ£¬ÓɱàÒëÆ÷Ÿö¶š¡£
bool ÊÇÁíÍâÒ»ÖÖÕûÐÍ£¬±àÒëÆ÷Ò²ÓÐÌØÊ⎊Àí¡£ŽóÌåÉÏ˵£¬Ò»žö bool ±äÁ¿µÄÊýֵҪÎÊÇ
0£¬ÒªÃŽÊÇ 1£»¶øÈκÎÒ»žö·ÇÁãµÄÖµ£¬Íš¹ýÀàÐÍת»»×ªµœ bool£¬¶Œ±ä³É 1¡£

±ê׌¹æ¶š long ÖÁÉÙºÍ int Ò»Ñù³€£¬int ÖÁÉÙºÍ short Ò»Ñù³€£¬ÕâºÜº¬ºý£¬ËùÒÔÎÒÓÃ
int ºÍ long long ±ÈœÏ¡£
Post by tyh_123
1£¬ÎªÉ¶²»ÓÃlong longºÍlong±ÈœÏ£¿
2£¬int²»ÊǺͱàÒëÆ÷ÓйØÃŽ£¿Ã»×¢ÒâintÊǶàÉÙ£¬ÏÂŽÎdebugµÄʱºò¿Ž¿Ž¡£
3£¬»·Ÿ³Î¬»€¿¿ŽóŒÒ¡£¡£¡£¡£Õâµã³ÌÐòÔ±µÄÒâËŒÓÈΪÇå³þ¹þ¡«¡«¡«
tyh_123
2009-10-19 10:29:19 UTC
Permalink
Ã÷°×ÁË¡£ÒòΪ¡£ÎÒ·¢ÏÖlong ºÍint ³€¶ÈŸ­³£Óвî±ð
Post by tyh_123
1£¬ÎªÉ¶²»ÓÃlong longºÍlong±ÈœÏ£¿
acc
2009-10-19 08:31:00 UTC
Permalink
¿ÉÄÜÔÚÏÂÃæµÄÌØÊâÇé¿öÏ£¬Äã»áŸõµÃ long long ÀŽµÄºÜŒ°Ê±£º

ÄãÐèÒªŽŠÀí 32 λÒÔÉÏ£¬64 λ ÒÔϵÄÕûÊýŒÓŒõ·š£š²»¿ŒÂÇ 64 λʱÕýÕýÏàŒÓºÍžºžºÏàŒõ¿ÉÄÜÔì³ÉµÄÒç³ö£©£¬Èç¹ûûÓÐ long long£¬ÄãŸÍµÃ×ÔŒºŽŠÀíœøλºÍœèλ£»ÓÐÁË long long£¬ŸÍºÍ int
Ò»ÑùʹÓÃÁË¡£

ҪÎÄãÏëʹÓÃÒ»žö±êÖŸ×飬ÐèÒªÈýËÄÊ®žö±ê֟λ¡£ÕýºÃÓà long long¡£

²»¹ýÎÒŸõµÃ long long Ò»°ãÇé¿öÏ»¹ÊÇÓÃÓÚÌṩ 32/64 λŒÆËã»úÖ®ŒäµÄŒæÈÝ¡£Èç¹û³öÓÚ¡°ÔöŒÓ int µÄ³€¶ÈÒÔÓÃÓÚŒÆË㡱µÄÄ¿µÄ£¬Ò»žöÊýÈç¹û³¬¹ýÁË 32 룬ÄÇÃŽËüÒ²ÓпÉÄÜ
³¬¹ý 64 룬long long ²»œâŸöÎÊÌâ¡£
Post by tyh_123
ÎÒŽíÁË¡£¡£¡£¡£
µÄÈ·long longÊÇÒ»Õûžö¹ØŒü×Ö.ÄÜ˵˵long long²»£¿
buzzard
2009-10-24 00:51:00 UTC
Permalink
看来你没见到过long long ago,这样的定义

On Mon, 19 Oct 2009 13:51:07 +0800, "tyh_123" <***@2.com> wrote:
--
Post by tyh_123
unsigned long long a;
unsigned long b;
a是b的2倍。。。。。。长见识了。。。。
tyh_123
2009-10-24 04:44:20 UTC
Permalink
englishŒû¹ý¶øÒÑ
¿ŽÀŽÄãûŒûµœ¹ýlong long ago£¬ÕâÑùµÄ¶šÒå
--
Post by tyh_123
unsigned long long a;
unsigned long b;
aÊÇbµÄ2±¶¡£¡£¡£¡£¡£¡£³€ŒûʶÁË¡£¡£¡£¡£
Loading...