I'm messing around a bit with Windowsz stuffy, i'm really knew..but i'm at a bit of a problem here. I need, somehow, for SetConsoleTitle() to recognize whitespace in a string and not terminate the string..somehow this is happening..
So heres my code:
Very general and of coarse i'm coming from C++, just want to get a bit more of a grasp on console aps. But for some reason..either cin >> is recognizing whitespace in the input as the variable terminator, or somehow SetConsoleTitle() doesn't like the whitespace that is supposedly in the char array. Anyone know which one it is? And what I could do(and why it happens), to fix it?Code:#include <windows.h> #include <iostream> #include <conio.h> using namespace std; int main() { char *title; cout << "What would you like the title to be? "; cin >> title; SetConsoleTitle(title); cout << "Hello World!" << endl; getch(); return 0; }
Also, do you know of any good win programming links that you could pass my way? I would appreciate it.
NOTE:In this case, the string length and amount of whitespace is obviously dynamic in nature.