cout
-
Is there a way to use cout<< or something like it without including iostream. I have a simple app with one cout statement and no inputs. The file is 5k without iostream included, but 260k with it. Regards Paul
use
printf();
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
-
use
printf();
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
-
use
printf();
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
-
But the two requirements were "...to use cout<< or something like it without including iostream." Using
printf()
and includingstdio.h
satisfy both of those requirements.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
-
Try this, if you are using Win API only: INT CDECL ConPrintf (LPCTSTR lpszFormat, ...) { TCHAR szBuffer[1024]; INT iRet; DWORD cbWritten; HANDLE hStdOut = NULL; va_list va; va_start (va, lpszFormat); iRet = wvsprintf (szBuffer, lpszFormat, va); va_end (va); hStdOut = GetStdHandle (STD_OUTPUT_HANDLE); WriteConsole (hStdOut, szBuffer, iRet * sizeof (TCHAR), &cbWritten, NULL); return iRet; } Usage is identical to wsprintf, but it writes to console output.