C语言
文章平均质量分 60
breezes2008
放弃也是一种美.
展开
-
C遍历磁盘文件
研究了一下午,终于用C语言写出了遍历磁盘上所有文件的代码。采用了是递归遍历算法。 算法描述如下: while 当前文件夹有文件 { if 文件是子文件夹 递归调用; else 处理该文件 } 其中, fblk为指定的保存文件信息的一个结构,定义如下: ┏━━━━━━━━━━━━━━━━━━┓ ┃struct ffblk ┃ ┃{ ┃ ┃ char ff_reserved[21]原创 2009-03-21 23:33:00 · 2385 阅读 · 0 评论 -
阿基米德螺旋线-画无线扩大圆
#include "stdio.h"#include "graphics.h"#include "math.h"#define PI 3.14159static double th=PI/180;void init(void);void draw(void);void close(void);main(){ init(); draw(); close();}void init(void){ in原创 2009-03-24 13:50:00 · 1292 阅读 · 0 评论 -
画心的源程序
#include "stdio.h" #include "graphics.h" #include "math.h" #define a 60 #define PI 3.1415926 float th=PI/180; void StartPic(void) { int gr=DETECT,gm; initgraph(&gr,&gm,"c://turboc2"); cleardevice()原创 2009-03-23 16:17:00 · 1570 阅读 · 0 评论 -
01背包问题---C源程序
/* *作者:breezes *日期:19:57 2009-4-20 *描述:01背包问题求解 */#include "stdio.h"#include "malloc.h"#define DEBUG 0 void init(void);void deal(void);void show(void);void destory(void);/*id,value,weight分别表示物品的号码连原创 2009-04-20 20:29:00 · 1352 阅读 · 0 评论 -
java通过jni调用C程序
简单JNI例子示例功能:JAVA程序通过调用C语言编写的2个整数相加程序,并把结果返回到JAVA程序中。步骤: Step1.用记事本编写以下代码,保存为:Sum.java代码如下: public class Sum{ public native int add(int x,int y); //本地方法申明 static{原创 2009-06-14 20:00:00 · 2719 阅读 · 0 评论 -
C清除当前行内容
printf("/r%*c/r",79, );printf("%*c",len, );/r表示光标返回到当前行首,%*c表示输出len个空格。原创 2009-06-14 19:44:00 · 2967 阅读 · 0 评论