Originally Posted by imrrann
I have prohibited to use system or exec family of commands for implementing LS in my shell using C.
Any function which would return the names of files and sub-directories in the current working directory
Ok. You've told us what you WANT
, but not what you've DONE
. What have you tried? And the fact that you say you can't use system or exec calls is telling...that almost shouts that this is homework.
Did you bother to try to look this up? Google for it? Do ANYTHING?
From a 10 second Google search: