title: in C, a variable doesn't retain the value i assign it and goes back to 0
body: <p>I am writing a simple game engine in C and I have come across a very odd problem.</p>
  
  <pre><code>//SANJI
  objs[1].animation = 1;
  objs[1].pho.h = 52;
  objs[1].pho.w = 25;
  objs[1].pho.tmp_pos.x = 190;
  objs[1].pho.tmp_pos.y = 40;
  objs[1].pho.gravity = 1;
  objs[1].hp = 10;
  
  printf("%d\n", objs[1].hp);//outputs 0???????
  </code></pre>
  
  <p>It seems no matter what I do the variable (member) <code>hp</code> is refusing to accept the assignment and goes back to <code>0</code>. I tried searching with Google, but I am afraid I am unable to phrase this problem accurately.</p>
  
  <p>EDIT:
  this is the definition of the  OBJ struct:</p>
  
  <pre><code>struct OBJ{
  //animation
  char animation;//if true apply animation; experimetnal
  
  MOVIE   sprites;
  PHYSOBJ pho;
  
  //OBJ_STATE state;
  OBJ_STATE states[SEQ_MAX][ST_MAX];
  int img;//number of image
  
  
  int hp;
  
  //control; AI or human
  char control;//0 human, otherwise AI
  };
  </code></pre>
  
  <p>Also there is no code between the printf and objs[1].hp = 10; i put the printf there for testing</p>