Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

cÖ¸Õë

cÖ¸ÕëµÄÔËËãÓÐʱºò»¹ÊǺÜÃÔ»óÈ˵ġ£
ÀýÈ磺
struct student {
int num;
int score;
int length;
};
struct student *pt;
pt = (struct student *) malloc(sizeof(struct student));
pt->num = 1;
pt->score = 90;
pt->length = 3 * sizeof(int);
printf("pt length:%d\n", *pt);
pt = (int *)pt + 1;
printf("pt length:%d\n", *pt);
pt = (int *)pt + 1;Ö®ºóptµÄÀàÐÍ»¹ÊÇstruct student£¬³¤¶È»¹ÊÇ12¡£
Ç¿ÖÆ×ª»»ÀàÐÍÔËËã·û()µÄ×÷ÓÃÊÇ£ºÉú³ÉÒ»¸öint *ÀàÐ͵Äpt£¬µ«ÊÇptÔ­À´µÄÀàÐÍ»¹ÊÇû±ä£¬
»»¾ä»°Ëµ¾ÍÊÇ£¬Ç¿ÖÆ×ª»»ÀàÐÍÔËËã·ûÖ»ÔÚÔËËãʱÆð×÷Ó㬲¢²»Ó°ÏìÔ­À´µÄÖµ¡£


Ïà¹ØÎĵµ£º

Àí½âcÖеÄÐòÁеã

Àí½âcÖеÄÐòÁеã
 
 
http://blog.chinaunix.net/u1/42826/showart_364176.html
ÈÃÎÒÃÇÀ´¿´¿´ÏÂÃæµÄ´úÂ룺
int i=7;
printf(”%d\n”, i++ * i++);
ÄãÈÏΪ»á·µ»ØÊ²Ã´£¿56£¿no¡£ÕýÈ·´ð°¸ÊÇ·µ»Ø 49£¿ºÜ¶àÈË»áÎÊΪʲô£¿ÄѵÀ²»¸Ã´òÓ¡³ö56Âð£¿ÔÚccfaqÖÐÓзdz£Ï꾡µÄ½âÊÍ£¬¸ù±¾Ô­ÒòÔÚÓÚcÖеÄÐòÁÐ ......

C/C++: Ê®Áù½øÖÆ×ª10½øÖÆÔ´Âë ÊÕ²Ø

C/C++: Ê®Áù½øÖÆ×ª10½øÖÆÔ´Âë
ÊÕ²Ø



view plain
copy to clipboard
print
?
int
 hex_char_value(
char
 c)  
{  
    if
(c >= 
'0'
 && ......

Ò»¸öLinuxÏÂCÏ̳߳صÄʵÏÖ

ʲôʱºòÐèÒª´´½¨Ï̳߳ØÄØ£¿¼òµ¥µÄ˵£¬Èç¹ûÒ»¸öÓ¦ÓÃÐèҪƵ·±µÄ´´½¨ºÍÏú»ÙỊ̈߳¬¶øÈÎÎñÖ´ÐеÄʱ¼äÓַdz£¶Ì£¬ÕâÑùÏ̴߳´½¨ºÍÏú»ÙµÄ´øÀ´µÄ¿ªÏú¾Í²»ÈݺöÊÓ£¬ÕâʱҲÊÇÏ̳߳ظóö³¡µÄ»ú»áÁË¡£Èç¹ûÏ̴߳´½¨ºÍÏú»Ùʱ¼äÏà±ÈÈÎÎñÖ´ÐÐʱ¼ä¿ÉÒÔºöÂÔ²»¼Æ£¬ÔòûÓбØÒªÊ¹ÓÃÏ̳߳ØÁË¡£
ÏÂÃæÊÇLinuxϵͳÏÂÓÃCÓïÑÔ´´½¨µÄÒ»¸öÏ̳߳ء£Ï̳߳ػ ......

C/C++ std::string ÇдÊ

ÓÃÁËÈýÖÖ·½·¨...
#if 0
void StringTokenize(const std::string& strSrc, const std::string& strDelimit, std::vector<std::string>& vecSub)
{
if (strSrc.empty() || strDelimit.empty())
{
throw "tokenize: empty string\n";
......

C/C++ ÓëÔËËãºÍ»òÔËËãת»»´óСд

// & Óë,½«Ö¸¶¨Î»ÖÃÉèÖÃΪ0     | »ò,½«Ö¸¶¨Î»ÖÃÉèÖÃΪ1
//×¢: Ö»Õë¶Ô´¿×ÖĸµÄÇé¿ö
#include <stdio.h>
#include <string>
int main()
{
char str[6] = "xxing";
std::string str1 = "INGXX";
for(int i = 0; i < 5; i++)
{
str[i] &= 0xdf; ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ