   Why this line doesnt work ?
  Its kinda simple line O_O Heres part of the code:struct sprites{  int meuframe;  //BITMAP *p22, *p21, *p23, *p61, *p62, *p63;  //BITMAP *ab1, *ab2, *ab3, *ab4, *ab5;  //BITMAP *au1, *au2, *au3, *au4, *au5;  BITMAP *anim21;};struct soldado{  struct atributos atribs;  //struct equip equips[6];  //struct habilidade habilidades[4];  //struct magia magias[4];  struct sprites anim;  char nome[20];  int elemento;  int id;  int bid;  int dir;  int classe;  int delay;  int level;};struct meutime{  struct soldado soldados[50];  struct soldado soldados_ativos[10];  int pop;};struct data_save{  struct meutime meujogo;};struct data_save database;database.meujogo.soldados[quem].elemento = rand() % 5 + 1;    database.meujogo.soldados[quem].classe = 1; // soldado    database.meujogo.soldados[quem].atribs.max_delay = 1200 - (6 * database.meujogo.soldados[quem].atribs.agil) - (2*database.meujogo.soldados[quem].atribs.dezt);// this line crashes the game //database.meujogo.soldados[quem].anim.anim21 = create_bitmap(640, 460);//////////////////////////////////create_bitmap is a allegro function, witch i have included in the .cpp file. All comands involving the database are working but this aint. Am i making something really wrong ?   
  test if create_bitmap(640, 460) works ok.create a simple BITMAP * test = create_bitmap(640, 460)test   ;  The 'quem' variable is most likely >= 50, so that the out-of-bounds access to that array crashes your program.   ;  quem runs 1, then 2 then 3 only.the bitmap works, BITMAP *mypic;mypic = create_bitmap(640, 480);works perfectly !wheres the whole code:http://pastebin.com/yf534YmC   ;Quote:Original post by MadHippiequem runs 1, then 2 then 3 only.the bitmap works, BITMAP *mypic;mypic = create_bitmap(640, 480);works perfectly !wheres the whole code:http://pastebin.com/yf534YmCI feel like this is an entry for the obfuscated code contest; anyway, you are missing a call to allegro_init().Please, read the documentation next time:Quote:int install_allegro(int system_id, int *errno_ptr, int (*atexit_ptr)());Initialises the Allegro library. You must call either this or allegro_init() before doing anything other than using the Unicode routines. (...)