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语言编写的.DLL时,当包括.DLL的头文件或声明接口函数时,应加extern "C" { }。
如:
头文件cExample.h
#include <stdio.h>
#ifndef C_EXAMPLE_H
#define C_EXAMPLE_H
int add(int x,int y);
#endif
函数实现文件cExample.c(注意是.c文件)
#include<stdio.h>
#include "cExample ......
在C#里创建和使用C风格数据结构,即非托管的数据结构,可以提高性能。
1 数据结构的定义
看下面例子:
unsafe struct A {
public int x;
}
unsafe struct B {
pu ......
/*
* 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/S转向B/S,但是我觉得什么是C/S,什么是B/S?其实都是客户机服务器模式吧!以前根本没有B/S的概念,而如今这个B/S的概念怎么变得如此的夸张,浏览器明明就是一个客户端软件,只是把那些规范好的文本译成各种各样的格式,只是大家都遵循了这样的一个规定就变成了另一种 ......
系统介绍:
此系统具有传统视频会议的一切功能,基于浏览器界面,可以控制远程登陆,参会者可以同时看到演讲者和演讲内容,并清晰的听到演讲者声音,已经了回声和噪音的处理,此外还可以同声传译,以满足不同语种参会人的要求。参会者还能实现多会场自由切换,并可播放PPT等。
需要的请联 ......