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]) \
相关文档:
什么是空指针常量(null pointer constant)?
[6.3.2.3-3] An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer constant.
这里告诉我们:0、0L、'\0'、3 - 3、0 * 17 (它们都是“integer constant expression”)以及 (void*)0 等都是空 ......
1:类似junit的断言,只是在assert中的断言,如果不满足的话就程序退出。
比如
#include <assert.h>
int main(void)
{
assert(6 < 5);
system("pause");
return 0;
}
在执行到assert(6 < 5);
的时候因为不满足断言,于是程序退出。
如果不想让assert(6 < 5)起作用,就在最上面添加宏定义# ......
< type="text/javascript">
原文请见这里
。
GNU
C的一大特色(却不被初学者所知)就是__attribute__机制。__attribute__可以设置函数属性(Function
Attribute)、变量属性(Variable Attribute)和类型属性(Type Attribute)。
__attribute__书写特征是:__attribute__前后都有两个下划 ......
今天走上路上突然有感而发,我们老师一直给我们讲要从C/S转向B/S,但是我觉得什么是C/S,什么是B/S?其实都是客户机服务器模式吧!以前根本没有B/S的概念,而如今这个B/S的概念怎么变得如此的夸张,浏览器明明就是一个客户端软件,只是把那些规范好的文本译成各种各样的格式,只是大家都遵循了这样的一个规定就变成了另一种 ......
系统介绍:
此系统具有传统视频会议的一切功能,基于浏览器界面,可以控制远程登陆,参会者可以同时看到演讲者和演讲内容,并清晰的听到演讲者声音,已经了回声和噪音的处理,此外还可以同声传译,以满足不同语种参会人的要求。参会者还能实现多会场自由切换,并可播放PPT等。
需要的请联 ......