okay so I know that the function system("TITLE..."); can work for adding a title text to a program, but what if I want to display a variable in the title also, such as the user's name or something they searched for.
thanks for the tip about the stringstream, but when i try to put it into the program, i get this error:
error C2664: 'SetConsoleTitleW' : cannot convert parameter 1 from 'const char *' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
i put in this code for the stringstream, for any corrections:
1 2 3
ostringstream title;
title << "titlehere";
SetConsoleTitle(title.str().c_str());
Change the 'o' in 'ostringstream' to a 'w' and add an L before each string literal (L"title").
Either that, or #undef UNICODE before #include <windows.h>
it works great. thanks so much for helping me with this. now i guess that since i started getting rid of the system() function, are there alternatives for system("cls") and system("pause")?
i was just testing out the program and i have one more little problem. if i want the title to change in the middle of the program, it just adds on to the previous title. is there a way to clear the stringstream?