c疑惑留言
你说是写个动态库不就行了,还说写脚本,脚本跟动态库差别大去了
gcc编译的时候就能生成动态连接库
windows下面没有so的概念,windows叫dll
搜下Linux gcc 动态库
编写好c语言程序,就是file系统调用的几个函数,fopen,fread之类的
gcc编译成so文件,一个命令就搞定,我忘记具体的选项了
相关文档:
#include<stdlib.h>
#include<iostream>
#include<string.h>
using namespace std;
int main(void)
{
FILE *fp, *fp2;
char buf[1024*300];
fp = fopen("in.txt", "rb");
fp2 = fopen("out.txt", "wb+");
fseek(fp, 0, SEEK_END);
int iLen ......
函数名: stpcpy
功 能: 拷贝一个字符串到另一个
用 法: char *stpcpy(char *destin, char *source);
程序例:
#include <stdio.h>
#include <string.h>
int main(void)
{
char string[10];
char *str1 = "abcdefghi";
stpcpy(string, str1);
& ......
一. 首先做一个简单的so文件:
/**
* hello.c
* To compile, use following commands:
* gcc -O -c -fPIC -o hello.o hello.c
* gcc -shared ......
对于序列求和的程序大家不会陌生,而我今天看到的这个程序个人觉得比较好,所以贴上来共享一下。
要求:输入类似于87 98 67 56 0的任意序列,但是以零结尾。然后输出序列的和。
程序如下 :
/********************************************
* Name : sum.c
* Purpose : sum
* Author : zimo
  ......