Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Á´±íµÄ»ù±¾²Ù×÷(cʵÏÖ£©

  
Á´±í¶¨Òå¼°²Ù×÷µÄÔ´Îļþ£ºemployee.h
//
#pragma once
#ifndef __EMPLOYEE_H__
#define __EMPLOYEE_H__
#include<stdio.h>
#include<malloc.h>
typedef struct employee{
int id;
int age;
int salary;
}EmpType;
typedef struct Node{
EmpType data;
struct Node *next;
}LNode,*PNode ,*LinkList;
typedef LinkList EmpLinkList;
//³õʼ»¯Á´±í
int InitEmpLinkList(LinkList *h)
{
*h=(LinkList)malloc(sizeof(LNode));
if (!h) {printf("init failed!\n");return 0;}
(*h)->next=NULL;
return 1;
}
//ÏòÁ´±íÖÐposÖеÄλÖòåÈëÊý¾Ýdata
int InsertEmpLinkList(LinkList h,int pos,EmpType data)
{
int i=0;
PNode p=h,q;
while (p&&i<pos-1)
{
p=p->next;
i++;
}
if (!p||i>pos-1) {printf("the insert position is illegal!\n");return 0;}
q=(PNode)malloc(sizeof(LNode));
if (!q) {printf("can not create new node !\n");return 0;}
q->data=data;
q->next=p->next;
p->next=q;
return 1;
}
//´òÓ¡Á´±íÖÐageΪijֵµÄ½áµã
int PrintByAge(LinkList h,int age,PNode *pnode)
{
PNode p=h->next;
while (p&&p->data.age!=age)
p=p->next;
if (!p) {printf("can not find the age!\n");return 0;}
(*pnode)=p;
printf("%d,%d,%d",(*pnode)->data.id,(*pnode)->data.age,(*pnode)->data.salary);
printf("\n");
return 1;
}
//·µ»ØÄ³idµÄ½áµã
PNode FindNodeById(LinkList h,int id)
{
PNode p=h->next;
while (p&&p->data.id!=id)
p=p->next;
return p;
}
//·µ»ØÄ³idµÄλÖÃ
int GetPos(LinkList h,int id)
{
PNode p=h->next;
int i=0;
while (p&&p->data.id!=id)
{
p=p->next;
i++;
}
if (!p)
return 0;
return i;
}
//±éÀúÁ´±í
void TraverLinkList(LinkList h)
{
PNode p=h->next;
while (p)
{
printf("%d,%d,%d",p->data.id,p->data.age,p->data.salary);
printf("\n");
p=p->next;
}
}
#endif
Ö÷º¯Êý£¨²âÊÔ£©main.c
#include"employee.h"
int main(int argv,char * argc[])
{
EmpLinkList l; //¶¨ÒåÁ´±í
EmpType data; //¶¨ÒåÁ´


Ïà¹ØÎĵµ£º

c socket ·¢ËÍhttpÇëÇó

#include <sys/types.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <stdio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
int main(){
int sockfd;
int len;
struct sockaddr_in address;
int result;
char *strings="GET /svnup/rewrite.php HTTP/1 ......

C/C++Êý×éÃûÓëÖ¸ÕëÇø±ð

 ÒÔÏÂÎÄÕÂ×ªÔØÓÚ:ΪÁËѧϰºÍÊÕ²Ø
http://tech.163.com/school · 2005-08-23 11:05:18 · À´Ô´: Ìì¼«Íø
C/C++Êý×éÃûÓëÖ¸ÕëÇø±ð
¡¡¡¡ÒýÑÔ
¡¡¡¡Ö¸ÕëÊÇC/C++ÓïÑÔµÄÌØÉ«£¬¶øÊý×éÃûÓëÖ¸ÕëÓÐÌ«¶àµÄÏàËÆ£¬ÉõÖÁºÜ¶àʱºò£¬Êý×éÃû¿ÉÒÔ×÷ΪָÕëʹÓá£ÓÚÊǺõ£¬ºÜ¶à³ÌÐòÉè¼ÆÕ߾ͱ»¸ãºýÍ¿ÁË¡£¶øÐí¶àµÄ´óѧÀÏʦ£¬ËûÃÇ ......

²âÊÔ¶ÔCµÄÕÆÎճ̶È

 
ÏÂÃæÕâ¸ö³ÌÐòÊä³öʲô£¿
enum {false,true};
int main()
{
int i=1;
do
{
printf("%d\n",i);
i++;
if(i < 15)
continue;
}while(false);
return 0;
}
ÄãÏàÐÅô£¿ÏÂà ......

C/C++/VC++ ±äÁ¿ÃüÃû¹æÔò

C/C++/VC++ ±äÁ¿ÃüÃû¹æÔò
ÊÇVC++µÄô£¿
4.±äÁ¿·ç¸ñ
±äÁ¿¾¡Á¿²ÉÓÃÐÙÑÀÀûÃüÃû·¨£¬Í¬Ê±½áºÏVCµÄÔ­Ôò£»Ò»°ãÇé¿öÏ£¬±äÁ¿µÄÈ¡Ãû·½Ê½Îª£º
<scope><prefix><qualifier>
ÓйØÏîÄ¿µÄÈ«¾Ö±äÁ¿±ØÐëÓÃg_¿ªÊ¼£¬Àà³ÉÔ±±äÁ¿ÓÃm_£¬¾Ö²¿±äÁ¿Èôº¯Êý½Ï´óÔò¿É¿¼ÂÇÓÃl_ÓÃÒÔÏÔʾ˵Ã÷ÆäÊǾֲ¿±äÁ¿¡£
ǰ׺
ÀàÐÍ
ʾÀý
g_ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ