Title a console app?

Colin Mac's Avatar, Join Date: Jan 2007
Go4Expert Member
How do I title my console apps in C?
0
DaWei's Avatar, Join Date: Dec 2006
Team Leader
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:
0
Colin Mac's Avatar, Join Date: Jan 2007
Go4Expert Member
Thanks.