Title a console app?

Go4Expert Member
21Jan2007,21:25   #1
Colin Mac's Avatar
How do I title my console apps in C?
Team Leader
22Jan2007,00:18   #2
DaWei's Avatar
How you dink with a window obviously depends on the windowing system. It has nothing to do with the language. You don't give any platform information, which is not a great help to your potential respondents, as few of them are mind readers. If you haven't yet read the "Before you make a query" post, please do so. I can also recommend Eric Raymond's little dissertation.

Presuming recklessly that you are concerned with MS Windows, specifically XP, include windows.h and wincon.h (you do have the Platform SDK installed, right?). Then add code like this,
Code:
#include <stdio.h>
#include <windows.h>
#include <wincon.h>

int main()
{
	SetConsoleTitleA ("My Title");
	puts ("This window should have my title");
	getchar ();
	return 0;
}
The result will look like this:
Go4Expert Member
22Jan2007,00:54   #3
Colin Mac's Avatar
Thanks.