| | |
theres GOT to be a simple solution for this one. . .
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2006
Posts: 4
Reputation:
Solved Threads: 0
ok, i kinda feel like an idiot asking this, but here it goes
simple setup for example purposes.:
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
system("cd\")
return 0;
}
ok, as you've prolly already noticed, the CD\ will return an error saying that there is an invalid terminator because of the "\" .. all i want to do is change directories lol.. can someone help me out. thnx
simple setup for example purposes.:
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
system("cd\")
return 0;
}
ok, as you've prolly already noticed, the CD\ will return an error saying that there is an invalid terminator because of the "\" .. all i want to do is change directories lol.. can someone help me out. thnx
use the chdir() function instead of the system() because (1) its faster and (2) its safer
C++ Syntax (Toggle Plain Text)
chdir("c:\\");
I think it also works with #include <direct.h>
http://img476.imageshack.us/img476/5171/cut20ln.png
Piworld ™
[Tis simple as Pie]
C++ Syntax (Toggle Plain Text)
#include <stdio.h> #include <windows.h> #include <conio.h> #include <direct.h> //#include<unistd.h> using namespace std; int main() { chdir("C:\\Documents and Settings"); system("tree"); getchar(); return 0; }
http://img476.imageshack.us/img476/5171/cut20ln.png
Piworld ™
[Tis simple as Pie]
![]() |
Similar Threads
- Simple solution to database (C++)
- Help with Infostealer and Trojan.Metajuan (Viruses, Spyware and other Nasties)
- solution for screencapture from Analog monitor (Monitors, Displays and Video Cards)
- Need a Simple Solution (PHP)
- Help needed in simple app while using XML,XSL (XML, XSLT and XPATH)
- simple solution? Parsing question (C++)
- on a simple airline booking program (C)
- WMP Internal Application Error: the ultimate solution (Windows NT / 2000 / XP)
Other Threads in the C++ Forum
- Previous Thread: *.dat conversion to *.tax file pls help
- Next Thread: SHIFT key doesn`t work in C++
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer display dll dynamiccharacterarray email encryption error file format forms fstream function functions game generator givemetehcodez graph homeworkhelp iamthwee ifstream image input int java lib list loop looping loops map math matrix memory multiple newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg simple sorting spoonfeeding string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






