• Advertisement
Sign in to follow this  

warning: assignment makes pointer from integet witout a cast...... WTF?

This topic is 4849 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i have this in the globals: SDL_Surface *tiles[3]; and a bit down i have this: tiles[0] = LoadBMP("gfx/water.bmp"); tiles[1] = LoadBMP("gfx/desert.bmp"); tiles[2] = LoadBMP("gfx/grass.bmp"); on these three tiles[x] lines i get that warning: game.c:18: warning: assignment makes pointer from integer without a cast game.c:19: warning: assignment makes pointer from integer without a cast game.c:20: warning: assignment makes pointer from integer without a cast whats up with that?

Share this post


Link to post
Share on other sites
Advertisement
It's SDL_LoadBMP.

If you're just doing LoadBMP in your code, you're implicitly defining the function. Implicitly defined functions are expected to return int.

Share this post


Link to post
Share on other sites

$ gcc implicit.c
$ gcc implicit.c -Wall
implicit.c: In function `main':
implicit.c:4: warning: implicit declaration of function `exit'
$ mv implicit.c implicit.cpp
$ g++ implicit.cpp
implicit.cpp: In function `int main()':
implicit.cpp:4: error: `exit' undeclared (first use this function)
implicit.cpp:4: error: (Each undeclared identifier is reported only once for
each function it appears in.)
$ cat implicit.cpp
/* no includes! */

int main() {
exit(0);
}

Language differences.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement