Eliseo said:
Note that C++ has no 'commands'. 'system()' is a
standard library function.
when you want to do something with directories
The syntax you're asking about has nothing to do with
directories, but with 'escaped' characters, i.e. those
which cannot be directly expressed in a source code with
a single character. E.g. a newline character is expressed
as '\n', a tab character as '\t', etc. Since the backslash
('\') character is being used for this 'escape' character,
we need a way to express the backslash character itself.
This is done with the 'escape' character (the backslash),
followed by another backslash.
you
are forced to type \\ unstid of just one
Only in your source code.
(ex. system("md
c:\\newdir")
is there any way I can avoid this, I am making a VB
program that interacts with this C++ program and needs to have those
off.
They're already 'off'. Your string itself contains
no 'extra' backslashes.
When you write e.g. "C:\\newdir" in your C++ source
text, this expresses the string "C:\newdir". There's
no 'extra' backslash except in your C++ source code.
Try this example:
#include <iostream>
int main()
{
std::cout << "c:\\newdir" << '\n';
return 0;
}
Note that the output is:
c:\newdir
Thank alot. Please email me an answer if possible
This is a public forum. Post here, read here.
-Mike