Hey!

I'm a beginner and I am making a code about getting the directory of a file, but I have something that I don't understand.

What's the meaning of "./" in
DS = opendir ("./");

I have searched a lot of sites about C programming, but nothing gave me a good explanation. I have to present my code soon, forcing me to explain every single line of my code. Please help me. Thanks!

The "./" means "use the current directory where your application is running". The dot is the current directory. If it was "../" it would point to the directory above where you are. If it was "~/" then it would point to your home directory.

Thank you for your answer!

NP. Sometimes reading the manual helps... :-) In any case, it was a sensible question for a newbie. Sometimes what is obvious to us "old-timers" isn't so to newer programmers.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.