转载自:http://yangrenjun.iteye.com/blog/624549
getopt_long支持长选项的命令行解析,使用man getopt_long,得到其声明如下:
#include <getopt.h>
int getopt_long(int argc, char * const argv[],
const char *optstring,
const struct option *longopts, int *longindex);[......]
转载自:http://yangrenjun.iteye.com/blog/624549
getopt_long支持长选项的命令行解析,使用man getopt_long,得到其声明如下:
#include <getopt.h>
int getopt_long(int argc, char * const argv[],
const char *optstring,
const struct option *longopts, int *longindex);[......]
由于我们的数据库有专门的机器,所以我自己的机器并没有装Oracle。
Oracle提供的C++访问方式是,通过OCI(Oracle Call Interface,简称OCI)。
这个如果单独安装非常的麻烦(主要是很trick。。),下面以Oracle 11gr2为例,介绍Linux下配置OCI。
1、安装Oracle client驱动
Oracle官方的那个神马600MB的开发包就别想了,装了三次,都失败,什么库都没装上!
翻了半天,使用Google Hacking找出来这[......]
gcc可以通过-c99来强制打开c99,并且按规矩实现了stdint.h。但是vc就没这么规矩了,必须升级到vc2010才行,实验室的服务器显然没这么先进。。。。。。
解决方法:
http://stackoverflow.com/questions/126279/c99-stdint-h-header-and-ms-visual-studio
这里给出了一些很猛的人写的“可移植版本”stdint.h,在你的程序中直接引用这些可移植版本的stdint.h就可以了!
哎,觉得[......]
转自:http://www.linuxdiyf.com/viewarticle.php?id=63720
学习了LINUX下用C语言遍历文件夹,一些心得
struct dirent中的几个成员:
d_type:4表示为目录,8表示为文件
d_reclen:16表示子目录或文件,24表示非子目录
d_name:目录或文件的名称
具体代码如下,仅供参考
#include <stdio.h>
#include <dirent.h>
#i[......]
GString* exec_and_out(char* cmd)
{
GString* ret = g_string_new("");
FILE* stream = NULL;
char buf[128];
size_t len = 0;
//popen execute and open stream
stream = popen(cmd, "r");
if (stream != NULL)
{
while (!feof(stream))
{
len = fread([......]