Advertisement

Lets make a c++ program!

Started by January 29, 2011 12:27 AM
62 comments, last by sprite_hound 13 years, 9 months ago
#pragma deprecated(wWinMain)
Latest project: Sideways Racing on the iPad
Alter:
int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow )
into
int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
as you provided the wrong type for the command line parameter. It is not a wide string literal.

To make it is hell. To fail is divine.

Advertisement

... as you provided the wrong type for the command line parameter. It is not a wide string literal.


Not for WinMain; wWinMain however ...
update:


#include <windows.h>
#include <stdio.h>
// =P
class Object;
auto f(int x, int (*y)(double)) -> double {
#define main sscanf
return 0;}
int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow )
{
int a;
hInstance = hPrevInstance;
if(a=false == true) // at least a is inited now.
abort();
!!!a ? *reinterpret_cast<char*>(&a) : *reinterpret_cast<char*>(&a + 1) = 'lolz';
#pragma deprecated(wWinMain)

Everybody just wants to end the program. Why can't we have such nice things? :(

Anyways:

MessageBoxA(NULL, (char *)&a, "Derp", MB_OK);

(Yes, I know that there is no Null-Char in a)
unsigned bar[~0][~0][~0][~0][~0][~0][~0][~0];
"You insulted me!" I did not say that in the private message Tom Sloper!
Advertisement

Not for WinMain; wWinMain however ...

Oh god, why on earth does there exist such a thing. Also, I wonder why you all are so determined to pull in non-standard headers, use non-standard entrypoints and invoke undefined behaviour.
I thought this thread was about writing proper C++, in a way such that someone might learn something about the quirks of the language. Intentionally breaking stuff seems rather counterproductive.

Oh. The thread is in the Lounge. That explains a lot.

To make it is hell. To fail is divine.


'fastcall22' said:

Not for WinMain; wWinMain however …

Oh god, why on earth does there exist such a thing. Also, I wonder why you all are so determined to pull in non-standard headers, use non-standard entrypoints and invoke undefined behaviour.
I thought this thread was about writing proper C++, in a way such that someone might learn something about the quirks of the language. Intentionally breaking stuff seems rather counterproductive.

Oh. The thread is in the Lounge. That explains a lot.


printf("%d\n", (+-+(++a)+++a++,a));
Mike Popoloski | Journal | SlimDX
Insert before #define:

LABEL_01:

I'll start:#include <windows.h>


This does not compile on any machine I own on any standard C++ compiler. Are you sure it's correct, standard C++?

Stephen M. Webb
Professional Free Software Developer

This topic is closed to new replies.

Advertisement