Jump to content

  • Log In with Google      Sign In   
  • Create Account


C++ problem


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Al MacInnis   Members   -  Reputation: 122

Like
Likes
Like

Posted 30 January 2002 - 01:40 AM

I have a problem on my C++ application : I have Windows 2000, and using SDL libraries. When i use & define 2 SDL_Rect structures, i always get an application fatal error when defining the datas of the first structure. When i declare 2 SDL_Rect structures, and i define only one it runs perfectly.....
  
  SDL_Rect *coords;
  SDL_Rect *blah;

...

coords->x=0;
coords->y=0;
coords->w=100;
coords->h=100;

blah->x=100;
blah->y=100;
blah->w=25;
blah->h=25;

//in this case, the program hangs at the first line (coords->x=0)


coords->x=0;
coords->y=0;
coords->w=100;
coords->h=100;

/*blah->x=100;
blah->y=100;
blah->w=25;
blah->h=25;*/

//in this one, runs perfectly

   
Where's the trick ? Edited by - Al MacInnis on January 30, 2002 8:41:41 AM

Sponsor:

#2 granat   Members   -  Reputation: 122

Like
Likes
Like

Posted 30 January 2002 - 01:52 AM

You have created a pointer but not allocated whatever the pointer is supposed to point to...

Edited by - granat on January 30, 2002 8:52:53 AM

#3 Al MacInnis   Members   -  Reputation: 122

Like
Likes
Like

Posted 30 January 2002 - 05:41 AM

huuuuuuuuuh, shame on me
long time not coding here
Thx a lot




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS