#include <stdio.h> #include <sys/types.h> #include <dirent.h> int main (void) { DIR *dp; struct dirent *ep; dp = opendir ("./"); if (dp != NULL) { while (ep = readdir (dp)) if (strcmp(ep->d_name,".") && strcmp(ep->d_name, "..")) puts (ep->d_name); (void) closedir (dp); } else perror ("Couldn't open the directory"); return 0; } This program was tested! From
Simple Program to List a Directory
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
jar包衝突組建設計書
原創
2024-04-08 23:16:36
[codes] 最大利潤
Mayness
2020-06-21 19:51:07
[codes] 函數顆粒化
Mayness
2020-06-21 19:04:32
項目經理與產品經理?
SinoPoepoe
2020-06-19 08:44:41
MSQL v1.0 Released
hk_mars
2020-06-16 02:09:36
reusable_code
丢丢 and 二狗
2020-02-22 20:57:13
Guide Practice of Perl
hk_mars
2020-02-21 08:49:18
逆波蘭表示法Reverse Polish Notation
綦侬
2020-07-07 11:27:15
ZJU PAT 1018 錘子剪刀布
1018. 錘子剪刀布 (20) 時間限制 100 ms 內存限制 32000 kB 代碼長度限制 8000 B 判題程序 Standard 作者 CHEN, Yue 大家應該都會玩“錘子剪
綦侬
2020-07-07 11:27:14
[codes] 最大利潤
Mayness
2020-06-21 19:51:07
[codes] 函數顆粒化
Mayness
2020-06-21 19:04:32
項目經理與產品經理?
SinoPoepoe
2020-06-19 08:44:41
MSQL v1.0 Released
hk_mars
2020-06-16 02:09:36
reusable_code
丢丢 and 二狗
2020-02-22 20:57:13
Guide Practice of Perl
hk_mars
2020-02-21 08:49:18
24小時熱門文章
-
再談23種設計模式(3):行爲型模式(學習筆記)
-
Power Automate Desktop 安裝完,登錄後老是提示one driver 錯誤
-
微前端學習筆記(4):從微前端到微模塊之EMP與hel-micro方案探索
-
微前端學習筆記(1):微前端總體架構概述,從微服務發微
-
985 碩士程序員,空窗 4 個月沒有 Offer!
-
一文搞懂 Spring 循環依賴
-
賽博鬥地主——使用大語言模型扮演Agent智能體玩牌類遊戲。
-
VScode右鍵打開(添加到右鍵)
-
記一次 .NET某工控視覺自動化系統 卡死分析
-
WindowsServer--SQL Server搭建主從同步實現讀寫分離 - 事務性分發