ͨѶ¼C³ÌÐò´úÂë
#include <stdio.h>
#include <string.h> /* ³ÌÐò¶à´Îµ÷ÓÃbiodkey()£¬Ó¦°üº¬Í·Îļþbios.h */
#include <bios.h><br>/* ³ÌÐò¶à´Îµ÷ÓÃclrscr()£¬Ó¦°üº¬Í·Îļþconio.h */
#include <conio.h>
#define MAX 100
#define PAGE 2
#define PRINT1 printf("--------------------------------------\n")
#define PRINT2 printf("NUM---NAME---AGE---MOBILE---ADDRESS\n")
#define PRINT3 printf("%d,%s,%d,%s,%s,\n",message[i].num,message[i].name,message[i].age,message[i].mobile[15],message[i].address);
int sum;
struct message_type
{<br>int num; <br>char name[15]; /* nameÓ¦ÊÇÊý×é */
int age;<br>char mobile[15];<br>char address[30]; /* addressÓ¦ÊÇÊý×é */ }message[MAX];
main()
{
int choice;
sum = read_message();<br>bioskey(0);
{
clrscr();
printf("\n\n\n ********ͨѶ¼¹ÜÀíϵͳ********\n\n" );
printf(" 1.´´½¨×ÊÁÏ\n\n");
printf(" 2.Êä³ö×ÊÁÏ\n\n");
printf(" 3.×ÊÁϲéѯ\n\n");
printf(" 4.×ÊÁÏÌí¼Ó\n\n");
printf(" 5.×ÊÁÏɾ³ý\n\n");
printf(" 6.×ÊÁÏÐÞ¸Ä\n\n");
printf(" 7.×ÊÁÏÕûÀí\n\n");
printf(" 0.Í˳öϵͳ\n\n");
printf("ÇëÑ¡Ôñ(0-7):");
scanf("%d",&choice);
switch(choice)
{ case 1: input_message();break;
case 2: output_message();break;
case 3: inquire_message();break;
case 4: insert_message();break;
case 5: del_message();break;
case 6: revise_message();break;
case 7: sort_message();break;
case0:break;
}
}while(choice!=0);
save_message(sum);
printf("\n -ÒÔÉÏ×ÊÁÏÒѱ£´æ!-(ÎļþÃû:messagenotes.txt)\n"); /*±£´æÐÅÏ¢*/
save_message(int sum)
{
FILE *fp;
int i;
if((fp=fopen("messagenotes.txt","wb"))==NULL)
{
printf("¶ÁÎļþ´íÎó!\n");
return;
}
for(i=0;i<sum;i++)
if(fwrite(&message[i],sizeof(struct message_type),1,fp)!=1)
printf("дÎļþ´íÎó!\n");
fclose(fp); /* Function: input_message() */
input_message()
{
int i=0; /* ±äÁ¿sÎÞÓã¬ÒÑɾ³ý */
clrsrc();
printf("\n\n ¼ÈëͨѶ¼\n"); /* ±ÊÎó */
printf("\n -------------------------------\n");
{
print
Ïà¹ØÎĵµ£º
[C/C++ Digestion] –
ÖØÔزÙ×÷·û
×÷Õߣº
Jason Lee @
http://blog.csdn.net/jasonblog
ÈÕÆÚ£º
2010-04-17
[1]
ÖØÔزÙ×÷·û
ÖØÔزÙ×÷·û´Ó´óµÄ·½ÃæÀ´½²¿ÉÒÔ·ÖΪÁ½Àࣺ×îºÃ»ò±ØÐë×÷ΪÀàµÄ³ÉÔ±º¯ÊýµÄ£¬ÒÔ¼°Ïà·´¡£¶ø¾ßÌåµØ½²£¬×îºÃ»ò±ØÐë×÷ΪÀàµÄ³ÉÔ±º¯ÊýµÄÓи³Öµ²Ù×÷·û
( = )
¡¢Ï±ê²Ù×÷·û
( [] ) ......
½ñÌìÅäÖÃÁËÒ»ÏÂnetbeansµÄc++±àÒë»·¾³£¬ËùÒÔдһƪÈÕÖ¾±¸Íü£¬Í¬Ê±Ò²¹©¹ã´óÍøÓѲο¼ºÍѧϰ¡£
×¼±¸×ÊÔ´£º
1¡¢netbeans ¿ÉÒÔµ½¹Ù·½ÍøÕ¾ÏÂÔØzh-cn.netbeans.org/
2¡¢MinGW±àÒëÆ÷£¨MinGWÖÐÓÐg++ºÍgcc±àÒëÆ÷£©µã´Ë´¦ÏÂÔØ£¬¿ÉÒÔµ½ÎÒÌṩµÄcsdnµÄ¹²ÏíÏÂÔØ£¬ÓÉÓÚ´óСÏÞÖÆ·ÖÁ½²¿·Ö
µØÖ·£ºµÚÒ»²¿·Ö http://download.csdn.net/sour ......
1£© -/+£º Õâ¸ö³Æ×öscope, Èç¹ûÔÚº¯ÊýÇ°ÃæÊÇ- £¬ÄÇôÀí½âΪһ°ãµÄº¯Êý£»Èç¹ûÊÇ+£¬ ¿ÉÒÔÀí½âΪc++ÖеÄstaticº¯Êý
2£© º¯ÊýµÄ²ÎÊýÉùÃ÷£º
Èç¹ûûÓвÎÊýµÄ»°£¬ÔÚº¯ÊýÃûºóÃ棬¿ÉÒÔʲô¶¼²»Ð´£»
Èç¹ûÖ»ÓÐÒ»¸ö²ÎÊý£¬ÔÚ : ºóÃæÉùÃ÷²ÎÊýµÄÀàÐͺÍÃû³Æ£»
Èç¹ûÓжà¸ö²ÎÊýµÄ»°£¬Ã¿¸ö²ÎÊýÇ°Ã涼ҪÓÐÒ»¸ö : £¬ È»ºó½Ó×ÅÊDzÎÊýÀàÐͺͲΠ......
ÔÚC++ÖУ¬¹ØÓÚCPPµÄÍ·Îļþ»¥Ïà°üº¬µÄÎÊÌâºÜÈÃÈËÍ·ÌÛ£¬ÆäʵÎÒÃÇËÒ²²»Ô¸ÒâŪµÄ½á¹¹»ìÂÒ£¬ÄÑÒÔÀí½â£¬µ«ÓÐʱÓÖÊÇÓбØÐëµÄ¡£
¼Ù¶¨µ±Ç°ÓÐÁ½¸öÍ·Îļþ·Ö±ðΪ A.h ºÍ B.h£¬ÄÚÈÝ·Ö±ðÈçÏ£º
A.hÄÚÈÝΪ£º
#ifndef  ......
ÊÔÌâ5£º±àдһ¸öº¯Êý£¬×÷ÓÃÊÇ°ÑÒ»¸öchar×é³ÉµÄ×Ö·û´®Ñ»·ÓÒÒÆn¸ö¡£±ÈÈçÔÀ´ÊÇ“abcdefghi”Èç¹ûn=2£¬ÒÆλºóÓ¦¸ÃÊÇ“hiabcdefgh”
¡¡¡¡º¯ÊýÍ·ÊÇÕâÑùµÄ£º
//pStrÊÇÖ¸ÏòÒÔ'\0'½áβµÄ×Ö·û´®µÄÖ¸Õë
//stepsÊÇÒªÇóÒƶ¯µÄn
void LoopMove ( char * pStr, int steps )
{
¡¡//ÇëÌî³ä...
}
¡¡¡¡½ ......