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]) \
Ïà¹ØÎĵµ£º
ÔÙ˵ÔÚlinuxϽ¨Á¢.a ºÍµãso
µ½ÍøÕ¾ÏÂÔØ sqlite-amalgamation-3.6.22.tar.gz Õâ¸ö°ü£¬·´ÕýÎÒÏÂÁËsqlite3-3.6.22.bin.gz½âѹºó±àÒë²»ÁË¡£
½âѹ£¬ÔËÐÐ
# ./configure --host=armv5l-linux --prefix=/opt/sqlite3/arm --enable-threadsafe.
......
main.c
//³õʼ»¯¶ÓÁÐ
void InitQueue(LiQueue *q)
{
q=(LiQueue*)malloc(sizeof(LiQueue));
q->front=q->rear=NULL;
}
//ÅжÏÊÇ·ñΪ¿Õ
int QueueEmpty(LiQueue *q)
{
if(q->rear==NULL)
{
return 1;
}
else
{
......
1 ÎĵµËµÃ÷
2 Îļþ½á¹¹
2.1 ΪÁ˸üºÃµÄÀûÓÃCVSµÄÐ޸ļǼ¹¦ÄÜ£¬ÔÚcommitµÄʱºò£¬ÈÏÕæµÄÌîдÐ޸ļǼ¡£
2.2 Ϊ·ÀֹͷÎļþ±»Öظ´ÒýÓã¬Ó¦µ±ÓÃifndef/define/endif½á¹¹²úÉúÔ¤´¦Àí¿é£»
2.3 ʹÓÃ__cplusplusºê¶¨Ò壬ʹ³ÌÐò¿ÉÒÔ·½±ãµÄÒÆÖ²ÖÁC++»·¾³Ï£»
2.4 Óà #include ¸ñʽÀ´ÒýÓñê×¼¿âµÄÍ·Îļþ£¨±àÒëÆ÷½«´Ó±ê×¼¿âĿ¼¿ªÊ ......
µ¥Àýģʽ£º¶ÔÓ¦Ò»¸öÀàÖ»ÄÜÉú³ÉÒ»¸ö¶ÔÏó¡£
#include <stdio.h>
class A
{
private:
int id;
A() {}//°Ñ¹¹Ô캯Êý·ÅÔÚprivate£ºÏÂÄ¿µÄÊÇÔÚÀàÍâ²»ÄÜÔÚÕ»ÉÏÖ±½Ó·ÖÅä¿Õ¼ä¶¨Òå¶ÔÏó¡£
public:
static A *pt;
static A *instance()
  ......
×ÜÊDZ»Í¬Ñ§ÃÇÎʵ½£¬ÈçºÎѧϰCºÍC++²Å²»Ã£È»£¬²Å²»ÊÇÂÒѧ£¬ÏëÁËһϣ¬ÕâÀï¸ø³öÒ»¸ö×ܵĻظ´¡£
¡¡¡¡Ò»¼ÒÖ®ÑÔ£¬»¶ÓÅÄש¹þ¡£
¡¡¡¡1¡¢¿ÉÒÔ¿¼ÂÇÏÈѧϰC.
¡¡¡¡´ó¶àÊýʱºò£¬ÎÒÃÇѧϰÓïÑÔµÄÄ¿µÄ£¬²»ÊÇΪÁ˳ÉΪһ¸öÓïÑÔר¼Ò£¬¶øÊÇÏ£Íû³ÉΪһ¸ö½â¾öÎÊÌâµÄר¼Ò¡£×öÒ»¸öÓÐÓõijÌÐòÔ±£¬×öÒ»¸ö׬ǮµÄ³ÌÐòÔ±¡£ÎÒÃǵļÛÖµ£¬½«ÌåÏÖÔÚ¿Í ......