cÖÐÊý×é´óС²»ÄÜÓñäÁ¿µÄÒ»¸ö½â¾ö°ì·¨
½ñÌìÔÚдµ½ÓÃcÀ´½âÎöpostÊý¾ÝµÄʱºòÐèÒªÓõ½Ò»¸öÊý×é±äÁ¿À´·ÅpostµÄËùÓÐÊý¾ÝµÈ×ÅÀ´½âÎö£¬²»ÏëÌ«ÀË·ÑÄÚ´æÁË¡£ÓÚÊÇÏë×ÅÏÈÉêÇëÒ»¸ö×î´óÍþ¶ûŶcontent_length´óСµÄÊý×éÔÙ˵¡£µ«ÊDz»ÔÊÐíÓñäÁ¿À´¡£±ÈÈç
int length = atoi(getenv("CONTENT_LENGTH"));
char params[length];
memset(params, '\0', length);
ÄÇôchar params[length]¾Í±àÒ벻ͨ¹ý(ÎÒµÄÀí½âÊÇ£º±àÒëµÄʱºòϵͳҪȷ¶¨paramsµÄ´óС£¬¶ølength²»ÊÇÒ»¸öÈ·¶¨Öµ£¬¾ÍËãlengthÖ±½Ó¶¨ÒåΪһ¸öÊý×Ö£¬ÄÇôϵͳ»¹ÊDz»ÖªµÀ£¬ËùÒÔ¶¼¹æ·¶Îª²»¿ÉÒÔÕâÑù¶¨Ò壬µ«ÊÇÖÁÓÚÔÒòÎÒÒ²Ö»ÊDz²â¶øÒÑ)
Ð޸ijÉÕâÖ־ͺÃÄñ£º
int length = atoi(getenv("CONTENT_LENGTH"));
char *params = malloc(length * sizeof(char));
memset(params, '\0', length);
Ïà¹ØÎĵµ£º
Linux I2CºËÐÄ¡¢×ÜÏßÓëÉ豸Çý¶¯
×¢:
ÔÚlinux2.6.32°æ±¾ÖÐÓÐÕâÑùµÄ´úÂëÓë×¢ÊÍ:
struct i2c_driver {
unsigned int class;
/* Notifies the driver that a new bus has appeared or is about to be
* removed. You should avoid using this if y ......
1. ö¾ÙµÄ¶¨Òåö¾ÙÀàÐͶ¨ÒåµÄÒ»°ãÐÎʽΪ£º
enum ö¾ÙÃû{ ö¾ÙÖµ±í };
ÔÚö¾ÙÖµ±íÖÐÓ¦ÂÞÁгöËùÓпÉÓÃÖµ¡£ÕâЩֵҲ³ÆΪö¾ÙÔªËØ¡£
ÀýÈ磺
¸Ãö¾ÙÃûΪweekday£¬Ã¶¾ÙÖµ¹²ÓÐ7¸ö£¬¼´Ò»ÖÜÖеÄÆßÌì¡£·²±»ËµÃ÷ΪweekdayÀàÐͱäÁ¿µÄÈ¡ÖµÖ»ÄÜÊÇÆßÌìÖеÄijһÌì¡£
2. ö¾Ù±äÁ ......
%d ¶ÌÕûÐÎ,Ò»°ãÕ¼Á½¸ö×Ö½Ú
%u ÎÞ·ûºÅ¶ÌÕûÐÎ
%ld ³¤ÕûÐÎ,Ò»°ãÕ¼Ëĸö×Ö½Ú
%c ×Ö·ûÐÍ
%s ×Ö·û´®
Ö÷ÒªÓÃÔÚÊäÈëÊä³öº¯Êý£ºscanf(),printf()Àï
\a:·äÃù£¬ÏìÁå
\b:»ØÍË£ºÏòºóÍËÒ»¸ñ
\f:»»Ò³
\n:»»ÐУ¬¹â±êµ½ÏÂÐÐÐÐÊ×
\r:»Ø³µ£¬¹â±êµ½±¾ÐÐÐÐÊ×
\t:ˮƽÖƱí
\v:´¹Ö±ÖƱí ......
±¾ÎÄÀ´×Ô£º http://blog.pfan.cn/xiuandfang/24935.html
±êÇ©:C C ++ string String Êý¾Ý½á¹¹
C×Ö·û´®´¦Àíº¯ÊýµÄʵÏÖ
C×Ö·û´®´¦Àíº¯ÊýµÄʵÏÖ£¨Linux£©
#include <stddef.h>
char * ___strtok = NULL;
char * strcpy(char * dest,const char *src)
&nb ......
ת×Ô£ºhttp://www.bmrtech.com/article/2008/081126.htm
ûÈËÄÜ·ñÈÏǶÈëʽӦÓÃÕý±äµÃÔ½À´Ô½Æձ顣µ«ÊÇ£¬µ±ÏµÍ³Ô½À´Ô½¸´ÔÓ£¬¶øÎÒÃǸ³ÓèϵͳԽÀ´Ô½¶àµÄÔðÈεÄʱºò£¬ÎÒÃǽ«±ØÐëÃæ¶ÔһЩÖØÒªÎÊÌâ¡£ÆäÖÐ×îÖØÒªµÄÎÊÌâÊÇ£ºÎÒÃÇÈçºÎ²ÅÄÜÈ·±£Ç¶ÈëʽϵͳÊÇ°²È«¿É¿¿µÄ£¿
C ±à³ÌÓïÑÔΪÓû§ÌṩÁËÐí¶àÇ¿´óµÄ¹¦ÄÜ£¬¼ ......