Hi!
I am programming a breakout game, but cant seem to get the leve loading working....
loading code:
File formatCode:int LoadLevel(int level){ char File ="level.dat"; char s[32]; Num = fscanf(File, " %s %d %d ", &level_x, &level_y); if(Num != 2){ return false; } return(1) ; }
Level file:Code:<x_coord> <y_coord>
I get the following errors:Code:1 10 5 20 10 30 15 40 20 45 25 50 30 55 35 60 40 65 45 70 50 75 55 80 60 90 65 100 70 110 75 120 80 130 85 140 90 150 95 160 100 170 105 180 110 190 115 200 120 210
:\Game Programming Projects\CrazyBalls 2\main.cpp(212) : error C2440: 'initializing' : cannot convert from 'char [10]' to 'char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
F:\Game Programming Projects\CrazyBalls 2\main.cpp(215) : error C2664: 'fscanf' : cannot convert parameter 1 from 'char' to 'struct _iobuf *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
F:\Game Programming Projects\CrazyBalls 2\main.cpp(534) : warning C4244: '=' : conversion from 'const double' to 'int', possible loss of data
F:\Game Programming Projects\CrazyBalls 2\main.cpp(537) : warning C4244: '=' : conversion from 'const double' to 'int', possible loss of data
Error executing cl.exe.
CrazyBalls 2.exe - 2 error(s), 5 warning(s)
Hope you can help me correct my errors....




Reply With Quote