Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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;
}
//·µ»ØijidµÄ½áµã
PNode FindNodeById(LinkList h,int id)
{
PNode p=h->next;
while (p&&p->data.id!=id)
p=p->next;
return p;
}
//·µ»ØijidµÄλÖÃ
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++ ´ò¿ªPDFÎĵµ

 wchar_t wsWorkingDir[256] = _T("");
 CString strPDF(_T(""));
 ::GetCurrentDirectory(256, wsWorkingDir);
 strPDF.Format(_T("%s"), wsWorkingDir);
 if (strPDF.GetAt(strPDF.GetLength()-1) != '\\')
 {
  strPDF += '\\';
 }
 strPDF += "doc\\my.pdf" ......

´ÓÁ½µÀ¾­µäÊÔÌâ̸C/C++ÖÐÁªºÏÌ壨union£©µÄʹÓÃ


´ÓÁ½µÀ¾­µäÊÔÌâ̸C/C++ÖÐÁªºÏÌ壨union£©µÄʹÓÃ
ÊÔÌâÒ»£º±àдһ¶Î³ÌÐòÅжÏϵͳÖеÄCPUÊÇLittle endian»¹ÊÇBig endianģʽ£¿
·ÖÎö£º
×÷Ϊһ¸ö¼ÆËã»úÏà¹ØרҵµÄÈË£¬ÎÒÃÇÓ¦¸ÃÔÚ¼ÆËã»ú×é³ÉÖж¼Ñ§Ï°¹ýʲô½ÐLittle endianºÍBig endian¡£Little endianºÍBig endianÊÇCPU´æ·ÅÊý¾ÝµÄÁ½ÖÖ²»Í¬Ë³Ðò¡£¶ÔÓÚÕûÐÍ¡¢³¤ÕûÐ͵ÈÊý¾ÝÀàÐÍ£ ......

C/C++ÖеÄÈÕÆÚºÍʱ¼ä time_tÓëstruct tmת»»

 ÕªÒª£º
±¾ÎÄ´Ó½éÉÜ»ù´¡¸ÅÄîÈëÊÖ£¬Ì½ÌÖÁËÔÚC/C++ÖжÔÈÕÆÚºÍʱ¼ä²Ù×÷ËùÓõ½µÄÊý¾Ý½á¹¹ºÍº¯Êý£¬²¢¶Ô¼Æʱ¡¢Ê±¼äµÄ»ñÈ¡¡¢Ê±¼äµÄ¼ÆËãºÍÏÔʾ¸ñʽµÈ·½Ãæ½øÐÐÁ˲ûÊö¡£±¾ÎÄ»¹Í¨¹ý´óÁ¿µÄʵÀýÏòÄãչʾÁËtime.hÍ·ÎļþÖÐÉùÃ÷µÄ¸÷ÖÖº¯ÊýºÍÊý¾Ý½á¹¹µÄÏêϸʹÓ÷½·¨¡£
¹Ø¼ü×Ö£ºUTC£¨ÊÀ½ç±ê׼ʱ¼ä£©£¬Calendar Time£¨ÈÕÀúʱ¼ä£©£¬epoch ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ