
存储数组 C
我想把Linuxcommandls生成的所有fileinfomation放到一个数组里请问要怎么作阿?drwxr-xr-x2a1178191students1024Sep...
我想把Linux command ls 生成的所有file infomation 放到一个数组里 请问要怎么作阿?
drwxr-xr-x 2 a1178191 students 1024 Sep 2 14:54 Link
-rw-r--r-- 1 a1178191 students 7238 Sep 2 20:50 ls3.c
-rw-r--r-- 1 a1178191 students 7225 Sep 2 20:49 ls3.c~
-rwxr-xr-x 1 a1178191 students 8767 Sep 2 20:50 ls3.ln
-rw-r--r-- 1 a1178191 students 32 Sep 1 17:50 MakeFile~
-rw-r--r-- 1 a1178191 students 35 Sep 1 17:51 Makefile
-rw------- 1 a1178191 students 28 Sep 2 14:55 x
-rw------- 1 a1178191 students 28 Sep 2 14:55 xlink-> x
-rw------- 1 a1178191 students 0 Sep 2 14:53 x~-> x 展开
drwxr-xr-x 2 a1178191 students 1024 Sep 2 14:54 Link
-rw-r--r-- 1 a1178191 students 7238 Sep 2 20:50 ls3.c
-rw-r--r-- 1 a1178191 students 7225 Sep 2 20:49 ls3.c~
-rwxr-xr-x 1 a1178191 students 8767 Sep 2 20:50 ls3.ln
-rw-r--r-- 1 a1178191 students 32 Sep 1 17:50 MakeFile~
-rw-r--r-- 1 a1178191 students 35 Sep 1 17:51 Makefile
-rw------- 1 a1178191 students 28 Sep 2 14:55 x
-rw------- 1 a1178191 students 28 Sep 2 14:55 xlink-> x
-rw------- 1 a1178191 students 0 Sep 2 14:53 x~-> x 展开
3个回答
展开全部
先通过重定向保存到一个文件中,然后可以通过一个程序通过文件流来一一放到一个数组中啊(但最好是放在一个动态链表中,因为数组不可以改变大小)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
只能放结构体吧..这里的数据类型不只一种
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
重定向到某个文件,然后从文件读取。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询