| | |
User input chdir c++
Thread Solved
![]() |
usethe string header so you can get the path from the user then pass it to chdir like this
Chris
C++ Syntax (Toggle Plain Text)
chdir(path.c_str());
Chris
Knowledge is power -- But experience is everything
Thanks for your reply!!
Sorry if I am being thick, but is this correct (some of the script has been removed)?
Thanks again for your help!
Sorry if I am being thick, but is this correct (some of the script has been removed)?
#include <string.h> using namespace std; string entry; cout << "1. Enter FULL PATH to directory: "; cin >> entry; chdir(path.entry_str()); cin.get(); return 0; }
Thanks again for your help!
This should help you out
http://msdn.microsoft.com/en-us/libr...e1(VS.80).aspx
I would read that but this is how to use it anyway
Chris
http://msdn.microsoft.com/en-us/libr...e1(VS.80).aspx
I would read that but this is how to use it anyway
C++ Syntax (Toggle Plain Text)
#include <string> #include <direct.h> using namespace std; int main(void){ string hello; hello = "C:\\"; _chdir(hello.c_str()); cin.get(); return 0; }
Chris
Last edited by Freaky_Chris; Nov 10th, 2008 at 2:44 pm.
Knowledge is power -- But experience is everything
![]() |
Similar Threads
- Remove Hidden Windows Components (Windows tips 'n' tweaks)
Other Threads in the C++ Forum
- Previous Thread: handling division by zero run-time errors: any suggestion?
- Next Thread: Background image
| Thread Tools | Search this Thread |
api array based binary bitmap business c++ c/c++ char class classes code coding commentinghelp compile console conversion count decide delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez graph guess gui homeworkhelp homeworkhelper iamthwee ifpug ifstream incrementoperators infinite input int integer java lib linkedlist linker loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem proficiency program programming project python random read recursion reference rpg string strings temperature template templates test text text-file tree url variable vector video win32 windows winsock word wordfrequency wxwidgets





