[Qt-interest] [SOLVE] OT: std::cout , output number as char type ?

Francisco Gonzalez Morell gzmorell at gmail.com
Mon Aug 23 11:49:57 CEST 2010


On Lunes 23 Agosto 2010 11:22:42 Aaron Lewis escribió:
> On 08/23/2010 05:20 PM, Bo Thorsen wrote:
> > This is completely off-topic. But anyway:
> > 
> > std::cout << static_cast<char>('a' + 5);
> 
> Right , standard solution.
> 
> Thanks !
One Qt way:
	#include <QTextStream>

	...
	QTextStream cout(stdout);
	QTextStream cin(stdin);

	cout <<  static_cast<char>('a' + 5);
	cout << QString().setNum('a'+5) << endl;




More information about the Qt-interest-old mailing list