易截截图软件、单文件、免安装、纯绿色、仅160KB

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/C++字符串处理函数,希望对初学者有一定的帮助。
C:
char st[100];
1. 字符串长度
   strlen(st);
2. 字符串比较
   strcmp(st1,st2);
   strncmp(st1,st2,n);   把st1,st2的前n个进行比较。
3. 附加
 & ......

extern "C"

如果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 ......

The C Programming Language 经典代码 any(s1,s2)

/*
* 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 ......

java中使用sqlite数据库

sqlite数据库第三方java扩展包下载地址:http://www.zentus.com/sqlitejdbc/
有2个包,一个是nested(嵌入式的),一个是native(本地的)。
区别在于:nested 不需要额外的dll文件,但是速度慢。native需要一个额外的dll文件,速度很快。
 1.使用nested包:sqlitejdbc-v037-nested.jar
java代码:
java 代码
packa ......

论C/S与B/S

今天走上路上突然有感而发,我们老师一直给我们讲要从C/S转向B/S,但是我觉得什么是C/S,什么是B/S?其实都是客户机服务器模式吧!以前根本没有B/S的概念,而如今这个B/S的概念怎么变得如此的夸张,浏览器明明就是一个客户端软件,只是把那些规范好的文本译成各种各样的格式,只是大家都遵循了这样的一个规定就变成了另一种 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号