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ÖеÄÐòÁеã
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½øÖÆÔ´Âë
ÊÕ²Ø
view plain
copy to clipboard
print
?
int
hex_char_value(
char
c)
{
if
(c >=
'0'
&& ......
ʲôʱºòÐèÒª´´½¨Ï̳߳ØÄØ£¿¼òµ¥µÄ˵£¬Èç¹ûÒ»¸öÓ¦ÓÃÐèҪƵ·±µÄ´´½¨ºÍÏú»ÙỊ̈߳¬¶øÈÎÎñÖ´ÐеÄʱ¼äÓַdz£¶Ì£¬ÕâÑùÏ̴߳´½¨ºÍÏú»ÙµÄ´øÀ´µÄ¿ªÏú¾Í²»ÈݺöÊÓ£¬ÕâʱҲÊÇÏ̳߳ظóö³¡µÄ»ú»áÁË¡£Èç¹ûÏ̴߳´½¨ºÍÏú»Ùʱ¼äÏà±ÈÈÎÎñÖ´ÐÐʱ¼ä¿ÉÒÔºöÂÔ²»¼Æ£¬ÔòûÓбØÒªÊ¹ÓÃÏ̳߳ØÁË¡£
ÏÂÃæÊÇLinuxϵͳÏÂÓÃCÓïÑÔ´´½¨µÄÒ»¸öÏ̳߳ء£Ï̳߳ػ ......
ÓÃÁËÈýÖÖ·½·¨...
#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";
......
// & Óë,½«Ö¸¶¨Î»ÖÃÉèÖÃΪ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; ......