| | |
User input chdir c++
Please support our C++ advertiser: Intel Parallel Studio Home
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 beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion count data database delete desktop developer directshow dll download dynamic email encryption error file forms fstream function functions game getline google graph gui homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text text-file tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





