By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,413 Members | 999 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,413 IT Pros & Developers. It's quick & easy.

How to open folders via c++

P: 84
Hi guys, I am currently triying to open folders by writing a program.

Using system() i should be able to open an specific folder but i can't.

i have tried using cd somefolder, cd.., cd\, cd /d but i cannot, any idea??
How should i do???
Mar 23 '07 #1
Share this Question
Share on Google+
4 Replies


RedSon
Expert 5K+
P: 5,000
check out the stdio.h library.
Mar 23 '07 #2

P: 84
check out the stdio.h library.
what do you mean??? Can I open folders using stdio.h????
Mar 23 '07 #3

RedSon
Expert 5K+
P: 5,000
what do you mean??? Can I open folders using stdio.h????
stdio.h has methods for you to use to open/close and traverse directories on the system. There is no such thing as opening a folder to a computer program. You are opening a file not a folder. All the words between the slashes are just the path to the file.
Mar 23 '07 #4

DeMan
100+
P: 1,806
stdio.h works with standard input/ouput including file handling (which means dirs too).

using system....are you working from the command line or from an IDE?
(you can also access files using there complete path, and may not need to change directories)
Mar 23 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.