µÚÒ»Ì⣺
struct struct_A{
int a;
char b;
int c;
short d;
};
struct_A *p = NULL;
sizeof(p)µÈÓÚ¶àÉÙ£¿
µÚ¶þÌ⣺
void GetMemory(char *p)
{
*p = ( char * ) malloc( 100 ) ;
}
int main ( )
{
char *str;
GetMemory(str);
strcpy( str , "hello baby" ) ;
printf(str);
return 0 ;
}
Êä³ö½á¹ûÊÇ£º£¿
µÚÈýÌ⣺
дһ¶ÎCÓïÑÔ³ÌÐò£¬ÊµÏÖÅжÏϵͳÊÇ´ó¶Ë£¨big-ending£©»¹ÊÇС¶Ë£¨little-ending£©´æ´¢ÏµÍ³¡£
Ï£Íû´ó¼Ò¶àÖ¸½Ì£¬Ð»Ð»£¡£¡£¡
µÚÒ»Ì⣺4
µÚ¶þÌ⣺ÎÞ·¨±àÒ룬ÀàÐͲ»Æ¥Åä
1. 4£¬Ö¸Õ붼ÊÇ4£¬Ã»Ê²Ã´ºÃ˵µÄ
2. ±ÀÀ££¬pÖµ´«µÝ£¬·ÖÅä³öÀ´µÄÄÚ´æ¸ù±¾²»Ö¸ÏòÔÀ´µÄstr£¬¾ßÌå¿´¸ßÖÊÁ¿C++£¬ÕâÊÇÀýÌâ
3. ¶¥Ò»¸öshort x = 1£¬ÊÇ2×ֽڵģ¬°Ñ¸ßλ´æ½øÒ»¸öchar£¬µÍλ´æ½øÒ»¸öchar£¬¿´¸ßµÍλ·Ö±ðÊÇʲô£¬Ò²¾ÍÊÇ˵ÄÚ´æÀïÊÏ0x0001»¹ÊÇ0x1000
1¡¢4
2¡¢lzÊDz»ÊÇÊãдÓÐÎó£¿
£³¡¡Óкܶ෽·¨£º±ÈÈ綨ÒåÒ»¸öÕâÑùµÄunion
union myun
{
struct mySt
{
unsigned short low:8;
unsigned short lower:8;
unsigned short high:8;
unsigned short higher:8;
}_mySt;
Ïà¹ØÎÊ´ð£º
ÇëÎÊVFPÖÐÈçºÎµ÷ÓÃC/C++º¯Êý£¿
ÄãÒªµ÷ÓÃʲô¹¦Äܵĺ¯Êý£¿Òª¿´¿´VFPÖÐÓÐûÓжÔÓ¦µÄº¯Êý£¬Èç¹ûÓоÍÊ¡×ÅÔÙµ÷ÓÃÁË¡£Èç¹ûûÓУ¬¿ÉÒÔ½«C/C++º¯Êýд¸öDLL»òFLL£¬È»ºóÔÚVFPµ÷Óü´¿É¡£
Ê®¶¹Èý ÀÏʦ£¬Ôõô²ÅÄÜÐÞ¸Ä×Ô¼ºµÄ ......
±¾ÈËÕýÔÚÓÃJava×öÒ»¸öC/S¼Ü¹¹µÄÏîÄ¿£¬
¿ÉÊÇÓÉÓÚÏîÄ¿±È½Ï´ó£¬Ç°ÆڶԼܹ¹µÄÉè¼ÆÓÈÆäÖØÒª£¬ÒòΪºóÆÚ¿ÉÄÜËæʱ»á¼Ó¸ö¹¦ÄÜ»òÕßÈ¥µôijЩ¹¦ÄÜ¡£
ËùÒÔÌصØÑ°ÇóÈçºÎÉè¼ÆC/SµÄ¼Ü¹¹Ê¹³ÌÐò¸ü¼ÓÃæÏò¶ÔÏó¸ü¼ÓÒ×ÓÚά ......
´ó¼ÒºÃ£º
ÎÒÏëʵÏÖ¼ì²âµ½²åÈëSD¿¨ºó×Ô¶¯½«SD¿¨¸ñʽ»¯µÄ¹¦ÄÜ£¬²»ÖªC/C++ÖÐÓÐûÓиñʽ»¯UÅ̵ĺ¯Êý£¿
ÁíÍ⣬ÎÒ²»ÏëʹÓÃSHFormatDrive£¬ÒòΪÕâ¸öº¯Êý»áµ¯³öÊÇ·ñÒª¸ñʽ»¯µÄÌáʾ¿ò£¬ÎÒÐèÒªµÄÊÇϵͳ×Ô¶¯¸ñʽ»¯£¬¶ø²Ù×÷Õß² ......
ÔÚ¸ùĿ¼/libÖдæ·ÅÒ»¸ölog.c£¬log.h£¬²¢ÓÃÏÂÃæµÄÓï¾ä£º
gcc -c log.c
ar crv liblog.a log.o
±àÒë³öÒ»¸öliblog.a¾²Ì¬¿â£¬È»ºóÔÚÎļþ¼Ð£º/testfileÖд´½¨Ò»¸ötest.cºÍtestc.c£¬test.cÖÐÒýÓÃÁËtestc.cÖж¨ÒåµÄ·½·¨ ......