So this error appears in the build out put :
..\Assets\Game.cpp(72): fatal error C1075: end of file found before the left brace '{' at '..\Assets\Game.cpp(43)' was matched
some times i have it some times i do not , and i cant figure out where i do something wrong
Here is the code , it brings me here after double click on the error line
#include "Game.h"
Game::Game( HWND hWnd,const KeyboardServer& kServer )
: gfx ( hWnd ),
kbd( kServer ),
x ( 300 ),
y ( 200 ),
m (225),
n (225),
o (225)
{}
void Game::Go()
{
gfx.BeginFrame();
ComposeFrame();
gfx.EndFrame();
}
void Game::ComposeFrame()
{
for(int i=0;i<=100;i++)
{
gfx.PutPixel(x+i,y,m,n,o);
}
for(int i=0;i<=100;i++)
{
gfx.PutPixel(x,y+i,m,n,o);
}
for(int i=0;i<=100;i++)
{
gfx.PutPixel(x+i,y+100,m,n,o);
}
for(int i=0;i<=100;i++)
{
gfx.PutPixel(x+100,y+i,m,n,o);
}
for(int i=0;i<=600;i++)
for(int j=0;j<=600;j++)
{
gfx.PutPixel(0+j,0+i,m,n,o);
if((0+j)>=300 &&(0+j)<=400 && (0+i)>=200 && (0+i)<=300)
{ m=0;
n=0;
o=0;
}
}
all variables m n o x y are defined in the main class as private all is fine there
Anoying fatal error when debuging....
Re: Anoying fatal error when debuging....
Code: Select all
for(int i=0;i<=600;i++)
for(int j=0;j<=600;j++)
{
gfx.PutPixel(0+j,0+i,m,n,o);
if((0+j)>=300 &&(0+j)<=400 && (0+i)>=200 && (0+i)<=300)
{ m=0;
n=0;
o=0;
}
ʕ •ᴥ•ʔ
Re: Anoying fatal error when debuging....
hmm i cant see it where did i go wrong
Re: Anoying fatal error when debuging....
You are missing a lot of colons, add one after "for(int i=0;i<=600;i++)"
and then add two more to the end.
Also, not sure if that's what you want, but "i<=600;i++" means that as i = 600, it will still add one digit, meaning that i's final value will be 601. If you want i to stop at 600 just leave it at i<600;
and then add two more to the end.
Also, not sure if that's what you want, but "i<=600;i++" means that as i = 600, it will still add one digit, meaning that i's final value will be 601. If you want i to stop at 600 just leave it at i<600;
ʕ •ᴥ•ʔ
Re: Anoying fatal error when debuging....
Looks like you're missing a curly bracket at the end.
P.S. is that what your code looks like in the source editor too (I mean with no tabs inserted)? If so, there's no wonder why you're making mistakes like this, nor why you're having trouble finding them when you make them.
P.S. is that what your code looks like in the source editor too (I mean with no tabs inserted)? If so, there's no wonder why you're making mistakes like this, nor why you're having trouble finding them when you make them.
Chili
Re: Anoying fatal error when debuging....
Ok thank you both .I will try the tab thing in future chili.