[C´úÂë]ͨѶ¼
/*****************test.c****************/
#include <stdio.h>
#include <stdlib.h>
#include "addr.h"
int main()
{
int flag=1;
while(flag)
{
switch(choose_menu())
{
case 1:add_person();break;
case 2:show_person_info();break;
case 3:search_person();break;
case 4:delete_person();break;
case 5:updata_person();break;
case 6:save_info();break;
case 7:quit();break;
default:break;
}
}
}
/*****************addr.c****************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "addr.h"
/*****************³£Á¿ÉùÃ÷****************/
char menu[]=
"+======================================================+\n"
"| ͨѶ±¡¹ÜÀíϵͳ |\n"
"+------------------------------------------------------+\n"
"| 1 Ìí¼ÓÁªÏµÈË |\n"
"| 2 ÏÔʾËùÓÐÁªÏµÈË |\n"
"| 3 ²éÕÒÁªÏµÈË |\n"
"| 4 ɾ³ýÁªÏµÈË |\n"
"| 5 ¸üÐÂÁªÏµÈË
Ïà¹ØÎĵµ£º
GPIO£¨General Purpose Input/OutputµÄËõд£©¾ÍÊÇоƬµÄÒý½Å£¬Òý½ÅÊǿɱà³ÌµÄ¿É¶ÔÒý½ÅµÄ¹¤×÷ģʽ½øÐÐÉèÖãºÊäÈëģʽ(¼ì²âÊäÈëÐźÅ)£¬Êä³öģʽ(Êä³ö0»ò1)£¬¸ß×è״̬(³£ÓÃÓÚADת»»)£¬»¹ÓнûÖ¹»òÔÊÐíÉÏÄÚ²¿ÏÂÀµç×è(ÉÏÀ£º¹Ü½Åͨ¹ýµç×è½Ó¸ßµçƽ£¬ÏÂÀ£º¹Ü½Åͨ¹ýµç×è½ÓµØ£¬Ò²¿ÉÒÔÍⲿ½ÓÉÏÀ»òÏÂÀµç×è)£¬»¹ÓйܽŸ´Óõȹ¦ÄÜ£¬¼´ ......
freadº¯ÊýºÍfwriteº¯Êý
1.º¯Êý¹¦ÄÜ
ÓÃÀ´¶Áдһ¸öÊý¾Ý¿é¡£
2.Ò»°ãµ÷ÓÃÐÎʽ
fread(buffer,size,count,fp);
fwrite(buffer,size,count,fp);
3.˵Ã÷
£¨1£©buffer£ºÊÇÒ»¸öÖ¸Õ룬¶ÔfreadÀ´Ëµ£¬ËüÊǶÁÈëÊý¾ÝµÄ´æ·ÅµØÖ·¡£¶ÔfwriteÀ´Ëµ£¬ÊÇÒªÊä³öÊý¾ÝµÄµØÖ·¡£
£¨2£©size£ºÒª¶ÁдµÄ×Ö½ÚÊý ......
1¡¢¿ìËÙ³õʼ»¯
char *str = new [size];
str[0]='\0';
2¡¢memcpyµÄÃîÓÃ
ÊÔÌâ6£ºÒÑÖªWAVÎļþ¸ñʽÈçÏÂ±í£¬´ò¿ªÒ»¸öWAVÎļþ£¬ÒÔÊʵ±µÄÊý¾Ý½á¹¹×éÖ¯WAVÎļþÍ·²¢½âÎöWAV¸ñʽµÄ¸÷ÏîÐÅÏ¢¡£
WAVEÎļþ¸ñʽ˵Ã÷±í
Æ«ÒƵØÖ· ×Ö½ÚÊý Êý¾ÝÀàÐÍ ÄÚ ÈÝ
ÎļþÍ·
00H 4 Char "RIFF"±êÖ¾
......
C++ÓïÑԵĴ´½¨³õÖÔÊÇ“a better C”,µ«ÊÇÕâ²¢²»Òâζ×ÅC++ÖÐÀàËÆCÓïÑÔµÄÈ«¾Ö±äÁ¿ºÍº¯ÊýËù²ÉÓõıàÒëºÍÁ¬½Ó·½Ê½ÓëCÓïÑÔÍêÈ«Ïàͬ.×÷ΪһÖÖÓûÓëC¼æÈݵÄÓïÑÔ,C++±£ÁôÁËÒ»²¿·Ö¹ý³ÌʽÓïÑÔµÄÌصã(±»ÊÀÈ˳ÆΪ“²»³¹µ×µØÃæÏò¶ÔÏó”),Òò¶øËü¿ÉÒÔ¶¨Òå²»ÊôÓÚÈκÎÀàµÄÈ«¾Ö±äÁ¿ºÍº¯Êý.µ«ÊÇ,C++±Ï¾¹ÊÇÒ»ÖÖÃæÏò¶ÔÏóµÄ³ÌÐ ......