unexpected end of file found???

Started by
6 comments, last by Metal Typhoon 21 years, 8 months ago
what kinda error is this ?? remark ?? i did check em all... Metal Typhoon
Metal Typhoon
Advertisement
Absolutely no friggin'' idea what you''re talking about.


Kami no Itte ga ore ni zettai naru!
神はサイコロを振らない!
quote:Original post by tangentz
Absolutely no friggin' idea what you're talking about.


Kami no Itte ga ore ni zettai naru!


neither do i.. take a looka t this simple example ...
#include <windows.h>BOOL	Keys[256];BOOL	Done = false;LRESULT CALLBACK WndProc (HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam){	switch (msg)	{		case WM_KEYDOWN:			Keys[wparam] = true;		break;		case WM_KEYUP:			Keys[wparam] = false;		break;		}	return DefWindowProc (hwnd,msg,wparam,lparam);}int WINAPI WinMain (HINSTANCE hinstance,HINSTANCE hprevInstance,LPSTR CmdLine,int ShowCmd){ 	WNDCLASS wc;	MSG		 msg;	HWND	 hwnd;	wc.cbClsExtra = 0;	wc.cbWndExtra = 0;	wc.hbrBackground = NULL;	wc.hCursor = LoadCursor (NULL,IDC_ARROW);	wc.hIcon = LoadIcon (NULL,IDI_APPLICATION);	wc.hInstance = hinstance;	wc.lpfnWndProc = WndProc;	wc.lpszClassName = "X";	wc.lpszMenuName = NULL;	wc.style = CS_OWNDC | CS_VREDRAW | CS_HREDRAW;	if (!RegisterClass (&wc))	{		MessageBox (NULL,"RegisterClass","Error # 1",MB_OK|MB_ICONEXCLAMATION);		return 0;	}	hwnd = CreateWindow ("X","X",WS_OVERLAPPEDWINDOW,50,50,800,600,NULL,NULL,hinstance,NULL);	ShowWindow (hwnd,SW_SHOW);	UpdateWindow (hwnd);	while (!Done)	{		if (PeekMessage (&msg,hwnd,0,0,PM_REMOVE))		{			if (msg.wParam == WM_QUIT)				break;			TranslateMessage (&msg);			DispatchMessage (&msg);		}		else		{			if (Keys[VK_ESCAPE])				Done = true;		}   return 0}  


Metal Typhoon

[edited by - Metal Typhoon on August 13, 2002 12:09:13 AM]
Metal Typhoon
Your missing a } at the end of your code.
"...."
You're missing a '}' for the while loop. That final bracket is being used to close off the loop, so there is no other bracket to close off the function. Hence, the compiler unexpectedly reached the end of the file without finding another bracket.

EDIT: Damn my longer answer. I was beat.


[edited by - Erunama on August 13, 2002 12:11:12 AM]
for your last while loop actually. im assumint you want } before the return
Rodger
you're missing semi-colon after return 0

OH, and you need another } to end your while loop

[edited by - h0-0t on August 13, 2002 12:19:33 AM]
:: h0-0t ::
If you''re using Dev Studio, place the cursor on a { or } and hit Ctrl-]. It will take you to the brace it thinks is the matching one. 90% of the time, this will help you find problems like this.

-scott

This topic is closed to new replies.

Advertisement