C½øÕ»³öջʱ³öÎÊÌâÁË£¡£¡£¡£¡ - C/C++ / CÓïÑÔ
C/C++ code:
#include<stdio.h>
#define MAXN 26
char stack[MAXN];
int top=0;
int push(x);
int pop(p_y);
void main()
{
char mpush=3;
char *mpop;
*mpop=0;
// printf("%d\n",*mpop);
push(mpush);
pop(mpop);
printf("%d\n",*mpop);
}
int push(x)
char x;
{
if(top>=MAXN)
return (1);
stack[top++]=x;
return(0);
}
int pop(p_y)//±ØÐëΪÒýÓÃÀàÐ͵ÄÐβÎ
char *p_y;
{
if(top==0)
return(1);
*p_y=stack[--top];
return (0);
}
´óÏÀÃÇÃǸø¿´¿´Õâ¶Î´úÂëÓÐʲôÎÊÌâ
£¿
char *mpop;
*mpop=0; —— Äã¸øÒ»¸öûÓзÖÅä¿Õ¼äµÄÄڴ渳ֵ£¬Óе㲻ºÏÊÊ
C/C++ code:
#include<stdio.h>
#include<stdlib.h>
#define MAXN 26
char stack[MAXN];
int top=0;
int push(char x);
int pop(char *p_y);
void main()
{
char mpush=3;
char *mpop = (char *)malloc(sizeof(char)); /*·ÖÅäÄÚ´æ*/
*mpop=0;
// printf("%d\n",*mpop);
push(mpush);
pop(mpop);
printf("%d\n",*mpop);
free(mpop);
}
int push(char x)
{
if(top>=MAXN)
return(1);
stack[top++]=x;
return(0);
}
int pop(char *p_y)//±ØÐëΪÒýÓÃÀàÐ͵
Ïà¹ØÎÊ´ð£º
дÁ˸ö²âÊÔ³ÌÐòÈçÏÂ
struct hostent *hp;
char AlarmDevIP[20];
int x2;
hp = gethostbyname("www.google.com");
if (hp)
{
......
ÎÒֻѧ¹ýÇ廪À¶·âÃæµÄCÓïÑÔ»ù´¡£¬Ïë¸üÉîÈëµÄѧϰ£¬¸Ã¿´Ê²Ã´ÊéºÃ£¿
C Primer Plus
C³ÌÐòÉè¼ÆÓïÑÔ(µÚ2°æаæ)
CÓïÑÔ³ÌÐòÉè¼Æ_ÏÖ´ú·½·¨
CÓïÑԲο¼ÊÖ²áµÚÎå°æ
CÓïÑÔ´óÈ«
CºÍÖ¸Õë
CÏÝÚåÓëȱÏÝ
Cר¼Ò±à³Ì
......
ÓÐÒ»10*10¾ØÕ󣬳ýÈ¥µÚÒ»¸öµã£¨0£¬0£©ºÍ×îºóÒ»µã£¨9£¬9£©£¬»¹Óа˸öµãΪ1£¬ÆäËû¶¼Îª0£¬ÒªÇóÓöþάÊý×é±íʾ¡£°Ë¸öµãÊÇËæ»úÉú³ÉµÄ£¬±àдÏà¹Ø³ÌÐò±íʾ¾ØÕóËùÓпÉÄÜÇé¿ö¡£
ÕæÐÄÇó½Ì¸÷λ¸ßÊÖ£¬°¥£¡±¾ÈËÌ«²ËÁË£¡ºÇºÇ£¡
......
ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎĶ¼¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À²®ÎĵÄ×Ö¿âÄãÓÐô£¿
ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......
±ÈÈçµ±³ÌÐò³öÏֶδíÎóʱ£¬ÈçºÎÈóÌÐòÖØпªÊ¼£¬¶ø²»ÊDZ»ÏµÍ³ÖÕÖ¹¡£
ÄãÏëÒì³£´¦ÀíÂð£¿
C²»Ö§³Ö¡£
ÔÙ˵£¬Òì³£ºÍ´íÎóÊDz»Í¬µÄ¡£
¶Î´íÎó¾ÍÓ¦¸ÃÖÕÖ¹¡£
assert()
abort()
exit()
µ±³ÌÐò³öÏֶδíÎóʱ,ÎÞ· ......