[SDL] Question about arrays...

matt mattmatteh at earthlink.net
Fri Feb 9 11:37:22 PST 2007


SlntHero at aol.com wrote:
> Question about arrays...
>  
>  
> Hi,
>  
> I have a C++ Class with the following:
> Int8 Playfield[3][3];
>  
> Later in my program I wish to initialize the above 2 dimensional array with  
> the following values:
> 0 / 1 / 0
> 1 / 1 / 1
> 0 / 1 / 0
>  
> I tried the following, but it does not compile:
>  
> Playfield
> = { 0, 1, 0,
>      1, 1, 1,
>      0, 1, 1 };
>  
> Can someone tell me how to do the above correctly?
>  
> Thanks in advance!
>  
>  
> Jesse
> _SLNTHERO at AOL.com_ (mailto:SLNTHERO at AOL.com) 
> _http://www.SilentHeroProductions.com_ (http://www.SilentHeroProductions.com) 
>  
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>   
this is not an sdl question.

int stuff[3][3] = {{1,2,3},{4,5,6},{7,8,9}};

also, is Int8 part of sdl?  i thought Uint8 was.   anyway, i just
include stdint.h and use uint8_t or int_t.

matt


More information about the SDL mailing list