A few quick questions...
I am writing a few quick games mostly for exerimentation's sake, and I'd like to write a simple installation program. How would I get a path from the user (ex. C:\thegame) and then install my files to that path? I know about the system() command, but it doesn't let you specify variables in between it's " and "... at least I don't think it does?
Another question: is there a function/class/SOMETHING to route output to the printer in C++ (not C plz)? I'd really appreciate an answer on this because it would be fun to mess around with.
Anyways, if anyone can answer my 2 questions, I'd appreciate it.
> get a path from the user (ex. C:\thegame) and then install my files to that path?
You have to construct your system() command strings at run time
Say like this
If you want to use some c++ (like strstreams) for creating the string, that's up to you.
cout << "Install where? ";
cin >> path;
sprintf( cmd, "md %s", path );
system( cmd );
> is there a function/class/SOMETHING to route output to the printer in C++
Nothing standard - it depends on
- your OS
- your compiler
- where your printer is plugged in
- what type of printer it is
What is sprintf()?
First, thx for your reply; it does make sense! :) But could you explain sprintf()? I know about fprintf() and printf(), but sprintf() is a new one to me.
> But could you explain sprintf()?
directs its output to a char array (not to a file (fprintf) or to the screen (printf))