Thread: Need help with some errors in my game

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    12

    Need help with some errors in my game

    I'va made a game and i'm trying to add highscore list onto it, i'm allmost there i just get some errors that i can't figure out. I think it will work nicely when these errors are gone.

    Code:
    main.c: In function `PrintHighscore':
    main.c:481: warning: format argument is not a pointer (arg 5)
    main.c:485: warning: format argument is not a pointer (arg 5)
    highscore.c: In function `InsertScore':
    highscore.c:34: warning: assignment makes integer from pointer without a cast
    highscore.c:42: warning: assignment makes integer from pointer without a cast
    highscore.c: In function `SaveHighscore':
    highscore.c:61: warning: format argument is not a pointer (arg 4)
    highscore.c: In function `LoadHighscore':
    highscore.c:90: warning: assignment makes integer from pointer without a cast
    highscore.c:91: warning: format argument is not a pointer (arg 3)
    highscore.c: In function `InsHighscore':
    highscore.c:115: warning: assignment makes integer from pointer without a cast
    These once i can't figure out.. I've got alittle help from this forum and some m8's to get this far.
    Could someone take a look and come with some suggestions of how to fix these errors.
    It would be great.

    - Mikalio (I'm new to c programming)

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    I don't know what you expect us to tell you without actually knowing what lines 481, 485, 34, 42, 61, 90, 91, and 115 say (plus some context), but I like guessing, so here goes:
    The first two lines (and all the similar ones) say you're trying to scanf or printf, but you forgot the format string (the part in quotes with all the % signs). The assignment makes integer from pointer without a cast mean you're trying to assign a string to an integer value, instead of parsing the string to get the integer out.

    How'd I do?

  3. #3
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    You are either not correctly prototyping your functions or you are not using them correctly. I am guessing probably the latter at this point.

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Without seeing the code, you're wasting your time. Obviously, you're mixing pointers with data, helter-skelter. That's all I can say from the list of errors.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > main.c:481: warning: format argument is not a pointer (arg 5)
    Study your printf/scanf call, and make sure the parameter matches the format.

    As for the others, post some code around those lines.
    - missing prototypes
    - mis-placed ( )
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. my upcoming UNO card game :)
    By Hussain Hani in forum Game Programming
    Replies: 5
    Last Post: 01-24-2008, 01:19 AM
  2. Please comment on my c++ game
    By MegaManZZ in forum Game Programming
    Replies: 10
    Last Post: 01-22-2008, 11:03 AM
  3. Engine <=> DX/OGL | c++ ?
    By darkcloud in forum Game Programming
    Replies: 6
    Last Post: 05-13-2005, 12:19 AM
  4. Game Designer vs Game Programmer
    By the dead tree in forum Game Programming
    Replies: 8
    Last Post: 04-28-2005, 09:17 PM
  5. Game structure, any thoughts?
    By Vorok in forum Game Programming
    Replies: 2
    Last Post: 06-07-2003, 01:47 PM