/*
**************************************************************************
* File Name: 4.address_book.c
* Function : 1)
* 2)
* Author : Xubing
* Created Time: 2016年11月04日
**************************************************************************
*/
#include <stdio.h>
#include <string.h>
#include <sqlite3.h>
#include <stdlib.h>
#define NAME_SIZE 20
#define PHONE_SIZE 15
static sqlite3 *db = NULL;
static char *errmsg = NULL;
struct node
{
char name[NAME_SIZE];
char phone[PHONE_SIZE];
struct node *next;
};
typedef struct node Node;
void create_table(sqlite3 *db);
void insert_record(sqlite3 *db);
int displaycb(void *para, int ncolumn, char ** columnvalue, char *columnname[]);
//void inquire_usecb(sqlite3 *db);
void Menu_Face();
void Menu();
void search_contact();
void contact_list();
void delete_contact();
void update_contact();
int main()
{
int ret;
ret = sqlite3_open("test.db", &db);
create_table(db);
while(1)
{
Menu();
#if 0
insert_record(db);
sqlite3_exec(db,"select * from addr_ablt",displaycb, NULL, &errmsg);
if(ret != SQLITE_OK)
{
printf("insert table error: %s\n", errmsg);
}
#endif
}
sqlite3_close(db);
return 0;
}
void Menu_Face()
{
printf(" ============================================================================\n");
printf(" | |\n");
printf(" | ADDRESS BOOK |\n");
printf(" | |\n");
printf(" ========================
基于sqlite3的通讯录(c语言)
最新推荐文章于 2023-02-09 14:12:08 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)