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ÓïÑԵĻص÷º¯Êý˼Ïë´úÂ룺
#include <stdio.h>
void *max(void *base, unsigned int nmemb, unsigned int size,
int (*compar)(const void *, const void *))
{
int i;
void* max_data = base;
char* tmp = base;
&nbs ......
/*
* 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¡£µ±È»£¬»¹ÓÐһР......
Linux C¡¡¡¡alarmº¯Êý---Çë¿´×îºó
¡¡¡¡alarmÒ²³ÆΪÄÖÖÓº¯Êý£¬Ëü¿ÉÒÔÔÙ½ø³ÌÖÐÉèÖÃÒ»¸ö¶¨Ê±Æ÷£¬µ±¶¨Ê±Æ÷Ö¸¶¨µÄʱ¼äµ½Ê±£¬ËüÏò½ø³Ç·¢ËÍSIGALARMÐźš£Òª×¢ÒâµÄÊÇ£¬Ò»¸ö½ø³ÌÖ»ÄÜÓÐÒ»¸öÄÖÖÓʱ¼ä£¬Èç¹ûÔÚµ÷ÓÃalarm֮ǰÒÑÉèÖùýÄÖÖÓʱ¼ä£¬ÔòÈκÎÒÔÇ°µÄÄÖÖÓʱ¼ä¶¼±»ÐÂÖµËù´úÌæ¡£
ËùÐèÍ·Îļþ
¡¡¡¡#include<unistd.h>
º¯Ê ......
×î½üʵÔÚÊÇ̫æÁË£¬ÕâƪÕûÕû¾ÍÍƳÙÁË1¸öÔÂÁË£¬ÊµÔÚÊǶԲ»Æð¡£Ö®Ç°±¾´òËãÕâ¸öÄ£¿é¾Í½áÊøÁË£¬Îļþ²Ù×÷¾Í²»Ð´ÁË£¬µ«ÊÇÎļþ²Ù×÷ÓÖÊÇÒ»¸öºÜÖØÒªµÄ¶«Î÷£¬¶øÇÒÒ²¸ÕºÃÄܹ»×ܽá֮ǰÎÒÃÇѧϰµÄËùÓÐ֪ʶ¡£Í¬Ê±Ò²ÎªÁ˽«Îļþ²Ù×÷Õâ¸ö³õѧÕßÈÏΪºÜÉñÃصĶ«Î÷¸ø±¾ÖÊ»¯¡£Òò´Ë£¬±¾Æª½«ÖðÒ»½éÉÜCÓïÑÔµÄÎļþ²Ù×÷¡££¨±¾Ä£¿éµÄÃüÃû±¾À´ÊÇÏëC\C++Ò ......