cÓïÑÔ»ù´¡£¨ÊÇʱºò²¹²¹cµÄ»ù´¡ÁË£©
¿´Êý¾Ý½á¹¹ñÍÕ»µÄʱºòдÁËÕâôһ¶Î´úÂë
#include<stdio.h>
#include<stdlib.h>
struct linkstack
{
int data;
struct linkstack *next;
};
int initstack(linkstack * S)
{
S = (linkstack *)malloc(sizeof(linkstack));
if(S == NULL) return 0;
S->next = NULL;
return 1;
}
int main(int argc,char **argv)
{
linkstack S;
if(initstack(&S))
printf("initstack success!!!\n");
return 0;
}
½á¹û±àÒëºó¾Í³öÏÖÁËÕâЩ´íÎó
@-laptop:~/makeprog/stack$ gcc -g -o linkstack main.c
main.c:11: error: expected ‘)’ before ‘*’ token
main.c: In function ‘main’:
main.c:22: error: ‘linkstack’ undeclared (first use in this function)
main.c:22: error: (Each undeclared identifier is reported only once
main.c:22: error: for each function it appears in.)
main.c:22: error: expected ‘;’ before ‘S’
main.c:23: error: ‘S’ undeclared (first use in this function)
ÏëÁËһϹÀ¼ÆÊÇÕâ¸ö½á¹¹Ì嶨ÒåµÄÎÊÌ⣬¾Í¸Ä³ÉÕâÑù
typedef struct node
{
int data;
struct linkstack *next;
}linkstack;
±àÒëͨ¹ý
È»ºóÕÒÒ»ÏÂÔÒò
µÚÒ»ÖÖ·½Ê½¶¨ÒåÁËÒ»¸öÈ«¾Ö
µÄ½á¹¹Ì壬ȻºóÔÚmain£¨£©º¯ÊýÖÐÓÃËüÀ´¶¨ÒåÒ»¸ö±äÁ¿£¬ËùÒÔ²»¿ÉÒÔ¡£µÚ¶þÖÖ·½Ê½ÓÃÁËtypedef£¬²é²éËüµÄÓ÷¨
typedef
ΪCÓïÑԵĹؼü×Ö£¬×÷ÓÃÊÇΪһÖÖÊý¾ÝÀàÐͶ¨ÒåÒ»¸öÐÂÃû×Ö¡£ÕâÀïµÄÊý¾ÝÀàÐͰüÀ¨ÄÚ²¿Êý¾ÝÀàÐÍ£¨int,charµÈ£©ºÍ×Ô¶¨ÒåµÄÊý¾ÝÀàÐÍ£¨struct
µÈ£©¡£
¡¡¡¡ÔÚ±à³ÌÖÐʹÓÃtypedef
Ä¿µÄÒ»°ãÓÐÁ½¸ö£¬Ò»¸öÊǸø±äÁ¿Ò»¸öÒ×¼ÇÇÒÒâÒåÃ÷È·µÄÐÂÃû×Ö£¬ÁíÒ»¸öÊǼò»¯Ò»Ð©±È½Ï¸´ÔÓµÄÀàÐÍÉùÃ÷¡£
µ«ÊÇ»¹ÊDz»ÄÜ·ÖÎö³öÀ´µ½µ×ʲôÔÒò£¬ÎÊÎÊȺÀïµÄÅóÓÑ
Ïà¹ØÎĵµ£º
Facts of C Programming Language
CµÄÒ»Ð©ÕÆ¹Ê
(Ó¢ÎÄÔÎÄ:http://www.programmingfacts.com/2009/12/01/facts-of-c-programming-language/)
C programming language was developed in 1972 by Dennis Ritchie and Brian Kernighan at the Bell Telephone Laboratories (AT&T Bell Laboratories) for use with the Un ......
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jee="http://www.springframework.org/schema/jee"
&nbs ......
ǰЩÌì¿´ÁËÀî¸Õ<struts2+hibernate+spring>ÄÇÊéÉϵÄhibernate£¬ÅäÖÃÎļþÒ²Êǰ´ÕÕÉÏÃæÇýøhibernate.cfg.xmlÎļþµÄ£¬Student.javaÅäÖõÄStudent.hbm.xmlÎļþ¾õµÃҲûʲôÎÊÌ⣬µ«²»Öªµ½Ôõô»ØÊ¾ÍÊDZ¨ connection can not open¡£ÓôÃÆ°¡£¬ºóÀ´ÎҾͰÑÊéÀïÃæµÄÅäÖÃÎļþºÍÔ´Â룬¸´ÖƵ½MyEclipseÏÂÃæµÄÒ»¸öÐÂwebÏîÄ¿ÖУ¬ÔËÐ ......
¸ãÁ˼¸ÌìµÄÎÊÌâ¡£±àÒëÒ»¸öÎļþʱ,ÀÏÊdzöÏÂÃæÕâ¸ö´í.
checking for C compiler default output file name… configure: error: C compiler cannot create executables
û·¨×Ó,ÕÒ¸ßÈ˰ïÎÒ´¦Àí,¹þ¹þ….¼Ç¼ÏÂÀ´.ÒòΪ64λµÄ»úÆ÷£¬Ä¬È϶ÔCFLAGSµÄÕâÊǽøÐÐÁËÉèÖÃ,ËùÒÔʹÓÃÏÂÃæµÄÃüÁîÇå¿ÕËû¾ÍÐÐÁË£¬ÕâÑùÈí¼þ¾Í²»»á±¨ ......
http://www.ddj.com/cpp/221600722
Q: HOW DO I... put timers with default actions in my C code?
A: Many times, we need to write programs that will only wait a certain specified amount of time for a user to do something. After that time, we need to assume that the user isn't going to do anything and ......