社区
C语言
帖子详情
函数findfirst()怎么用
笑面佛_正版
2002-04-28 02:54:49
在 dir.h 中 定义的用法是这样
int findfirst(const char *path, struct ffblk *ffblk,int attrib);
我用这样的代码他老说我的 t 变量指针有错,而且也不知道这个函数的作用是何,用法又
是怎么样的,哪位仁帮帮我
int s;
struct ffblk *t;
s=findfirst("C:\WINDOWS",t,0);
...全文
377
5
打赏
收藏
函数findfirst()怎么用
在 dir.h 中 定义的用法是这样 int findfirst(const char *path, struct ffblk *ffblk,int attrib); 我用这样的代码他老说我的 t 变量指针有错,而且也不知道这个函数的作用是何,用法又 是怎么样的,哪位仁帮帮我 int s; struct ffblk *t; s=findfirst("C:\WINDOWS",t,0);
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
唐古拉山
2002-04-28
打赏
举报
回复
给你一段程序参考,使用 BC31
----------------------------
#include <stdio.h>
#include <stdlib.h>
#include <dir.h>
#include <dos.h>
#include "conio.h"
#define ALL FA_RDONLY |FA_HIDDEN | FA_SYSTEM | FA_LABEL | FA_ARCH
void dirme(char * pfad);
void main()
{
clrscr();
dirme("c:\\*.*");
getch();
dirme("c:\\windows\\*.*");
getch();
}
void dirme(char * pfad)
{
struct ffblk block;
int ret;
int num=0;
for (ret=findfirst(pfad,&block,ALL);!ret; ret=findnext(&block))
{
printf("File%d : %s\n",num++,block.ff_name);
}
fangrk
2002-04-28
打赏
举报
回复
int s;
struct ffblk t;
s=findfirst("c:\\windows",&t,0);
wuhuar
2002-04-28
打赏
举报
回复
你要初始化一下你的指针t
fangrk
2002-04-28
打赏
举报
回复
s=findfirst("C:\\WINDOWS",t,0);
jbmw
2002-04-28
打赏
举报
回复
你定义了个未初始化的指针变量,所以出错了!!!
int s;
struct ffblk t;
s=findfirst("c:\windows",&t,0);
c语言文件夹_findfirst()
函数
介绍
c语言文件夹_findfirst()
函数
介绍
C++利用 _findfirst与_findnext查找文件的方法
C++ 文件查找 在C++中我们要如何查找文件呢?我们需要一个结构体和几个大家可能不太熟悉的
函数
。这些
函数
和结构体在的头文件中,结构体为struct _finddata_t ,
函数
为_findfirst、_findnext和_fineclose。具体如何使用,下面来一起看看吧 _findfirst与_findnext查找文件 一、这两个
函数
均在io.h里面。 二、首先了解一下一个文件结构体: struct _finddata_t { unsigned attrib; time_t time_create; time_t time_access; time_t time_wr
Exam_09_38.rar_find_first_not_of
在标准C++库中使用find_first_of以及 find_first_not_of的使用举例。 已知有如下string对象: “ab2c3d7R4E6” 编写程序寻找该字符串中所有的数字字符,然后再寻找所有的字母字符。以 两种版本编写该程序:第一个版本使用find_first_of
函数
,第二个版本使用 find_first_not_of
函数
js代码-findFirstNode
js代码-findFirstNode
Delphi 遍历windows目录下的文件
Delphi中使用System.SysUtils.findFirst,findnext和findclose
函数
进行目录遍历时,在Windows10及win11中会出现error code 18错误,在此提供一个解决方案,直接使用winapi完美解决
C语言
69,371
社区成员
243,080
社区内容
发帖
与我相关
我的任务
C语言
C语言相关问题讨论
复制链接
扫一扫
分享
社区描述
C语言相关问题讨论
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章