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

GNU C Library——最全的C函数说明

前天写一个小程序, 突然发现其实偶的C学的不怎么样啊,好多函数都不记得,在网上搜到的都是些乱七八糟的,没有原型,用起来不放心,用E文搜,搜到真正的Bible——
The GNU C Library Manual
这里面太全了,只是有一点不太好,E文的,读起来有点慢,感觉有点浪费时间
用C写了段小程序把一个五笔码文本文档转为SQLite3格式的数据库
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <regex.h>
#include <sqlite3.h>
int main(int argc, char** argv)
{
sqlite3 *db = NULL;
char *zErrMsg = 0;
int rc = 0;

rc = sqlite3_open("wubi.db",&db);
if( rc )
{
fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
sqlite3_close(db);
exit(1);
}
char *sql, insert[256];
sql = "CREATE TABLE word (cn VARCHAR(3) NOT NULL, first VARCHAR(4) NOT NULL, sec VARCHAR(4), pri SMALLINT DEFAULT 0)";
sqlite3_exec( db, sql, 0, 0, &zErrMsg );
sql = "CREATE TABLE wordgroup (cn VARCHAR(12) NOT NULL, first VARCHAR(4) NOT NULL, ind SMALLINT DEFAULT 0)";
sqlite3_exec( db, sql, 0, 0, &zErrMsg );
regex_t reg ;
regmatch_t pm[1];
char *pattern;
char buf[50];
const size_t nmatch = 1;
//取得正则表达式,并进行编译
pattern = argv[1];
int result = regcomp(®, pattern, REG_EXTENDED);
//逐行读取文件
while( fgets(buf, sizeof(buf), stdin) )
{
int e = strlen(buf);
if ( e > 0 && buf[e-1] == '\n' )
buf[e-1] = 0;
result = regexec( ®, buf, nmatch, pm, REG_NOTBOL );
if ( result == REG_NOMATCH )
continue;
int i = 0;
for ( i = 0; i < nmatch && pm[i].rm_so != -1; ++i )
{
int code = e - pm[i].rm_so;
printf("字符\"%s\"的长度为:%d\n",buf, e);

char *c = NULL, *a = NULL, *b = NULL , *word = NULL ;
word = (char *)malloc( 50*sizeof(char) );
c = (char *)malloc( 50*sizeof(char) );
a = (char *)malloc( 4*sizeof(char) );
b = (char *)malloc( 4*sizeof(char) );

//取一个字符串的子字符,前半部
strncpy( word, buf, pm[i].r


相关文档:

linux C正则表达式——POSIX正则测试

这是C的原程序
#include <stdio.h>
#include <regex.h>
int main(int argc, char** argv)
{
regex_t reg;
regmatch_t pm[10];
char *pattern;
char buf[50];
const size_t nmatch = 10;

pattern = argv[1];
int result = regcomp(®, pattern, REG_EXTENDED);
while( fgets ......

【转】C与C++的区别

在很大程度上,标准C++是标准C的超集.实际上,所有C程序也是C++程序,然而,两者之间有少量区别.下面简要介绍一下最重要的区别.
    在C++中,民,局部变量可以在一个程序块内在任何地方声明,在C中,局部变量必须在程序块的开始部分,即在所有"操作"语句之前声明,请注意,C99标准中取消了这种限制.
  &nb ......

C/C++ 头文件 常用头文件功能查询表

#include <assert.h>    //设定插入点
#include <ctype.h>     //字符处理
#include <errno.h>     //定义错误码
#include <float.h>     //浮点数处理
#include <fstream.h>    //文件输入/输出
#include  ......

ubuntu c/c++ IDE(开发环境)

前言 不断有网友将编译器 GCC 误认为 IDE(集成开发环境)       
期望脱离命令行
期望能在菜单中发现其身影
期望其能有一个集编辑编译链接调试运行于一体的界面
故本文给大家简单罗列一些 C/C++ 编程中可用的 IDE,或许你从中可以找一个你喜欢的。
为避免以下某个软件安装时不自动安装 ......

c操作翻转字符串


#include<stdio.h>
#include<malloc.h>
#include<string.h>
/*
* 翻转
*/
char *mystrrev(char *arr)
{
if (!arr)
{
return NULL;
}
char *temp = arr;
char t;
int leng = strlen(arr) + 1;
int l = (int)(leng / 2);
int i = 0;
while (l--)
{
t = arr[i];
arr[ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号