SQLite3µÄC±à³Ì
/*=================================
.* The Standard include file.
.*
.*===============================*/
#include <stdio.h>
#include <stdlib.h>
/*=================================
.*
.* The extend include file.
.*
.*===============================*/
#include "sqlite3.h"
/* #include "sqlite3ext.h" */
int main()
{
/* Connect SQLite system. */
sqlite3 *pDatabase = NULL;
int result;
char sql[500];
char *err_msg = NULL;
int i;
result = sqlite3_open("test.db3", &pDatabase);
if( result != SQLITE_OK ) {
printf("Failure to open the database.\n");
return -1;
} else
printf("Good to open the database.\n");
sprintf(sql,"BEGIN");
sqlite3_exec(pDatabase, sql,0,0,err_msg);
sprintf(sql, "CREATE TABLE [TestDB] (\
[id] int, [name] varchar(20), [age] int)");
/*
if (SQLITE_OK != sqlite3_exec(pDatabase, sql, 0, 0, &err_msg)) {
printf("operate failed: %s.\n", err_msg);
return -1;
}*/
for(i = 0; i < 10000; i++) {
sprintf(sql, "INSERT INTO [TestDB] ([id], [name], [age]) \
Ïà¹ØÎĵµ£º
¸Õ¿ªÊ¼Ñ§C/C++ʱ£¬Ò»Ö±¶Ô×Ö·û´®´¦Àíº¯ÊýÒ»Öª°ë½â£¬ÕâÀïÁоÙC/C++×Ö·û´®´¦Àíº¯Êý£¬Ï£Íû¶Ô³õѧÕßÓÐÒ»¶¨µÄ°ïÖú¡£
C£º
char st[100];
1. ×Ö·û´®³¤¶È
strlen(st);
2. ×Ö·û´®±È½Ï
strcmp(st1,st2);
strncmp(st1,st2,n); °Ñst1,st2µÄÇ°n¸ö½øÐбȽϡ£
3. ¸½¼Ó
& ......
/*
* Exercise 2-5 Page 48
*
* Write the function any(s1,s2), which returns the first location
* in the string s1 where any character from the string s2 occurs,
* or -1 if s1 contains no characters from s2. (The standard library
* function strpbrk does the same job but returns a pointer t ......
CÖвÉÓÃÁ˲»Í¬µÄµ÷Ó÷½Ê½À´µ÷Óú¯Êý£¬ÕâÀïµÄº¯Êýµ÷ÓøÅÄî¿ÉÄÜÓëÎÒÃÇͨ³£ËùÀí½âµÄº¯Êýµ÷ÓÃÓÐËù²»Í¬£¬ËüÃÇÖ¸µÄÊÇ´¦ÀíÆ÷ÔÚ´¦Àíº¯ÊýÉϵIJîÒì¡£Àí½âÕâЩ²»Í¬µÄ·½Ê½ÓÐÖúÓÚÎÒÃÇÀ´µ÷ÊÔ³ÌÐòºÍÁ´½ÓÎÒÃǵĴúÂë¡£ÔÚ´ËÎÒÏëÌÖÂÛÒ»ÏÂÖ÷ÒªµÄËÄÖÖº¯Êýµ÷Ó÷½·¨ÒÔ¼°Ö®¼äµÄÇø±ð£¬ËüÃÇÊÇ__stdcall¡¢__cdecl¡¢__fastcall¡¢thiscall¡£µ±È»£¬»¹ÓÐһР......