CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2009
    Location
    Kent, UK
    Posts
    8

    Question C++ Allegro - time(&secs) help!!!

    Hi

    I need help for my pong game.
    I am using Dev-C++, using the 'default compiler'.
    I am using the tutorial at cppgameprogramming.com

    Here is my code for the game setup.

    void gamesetup(){

    acquire_screen();
    rectfill ( buffer, p1x, p1y, p1x + 10, p1y + 60, makecol ( 102, 255, 102));
    rectfill ( buffer, p2x, p2y, p2x + 10, p2y + 60, makecol ( 255, 204, 255));
    circlefill ( buffer, x, y, 5, makecol ( 0, 0, 230));
    draw_sprite( screen, buffer, 0, 0);
    release_screen();

    time(&secs);
    srand( (unsigned int)secs);

    dir = rand() % 4 + 1;
    }


    I get this error:

    148 G:\Cpp\Classics\Pong\main.cpp cannot convert `time_t (*)()' to `time_t*' for argument `1' to `time_t time(time_t*)'

    Line 148 is the time(&secs); one.

    I used the exact code from the tutorial, with edited variables, function names, and colours.

    Can someone please help me sort this out.

    Thanks

    Mark

  2. #2
    Join Date
    Feb 2002
    Posts
    4,640

    Re: C++ Allegro - time(&secs) help!!!

    What is "secs"?

    Viggy

  3. #3
    Join Date
    Sep 2009
    Location
    Kent, UK
    Posts
    8

    Re: C++ Allegro - time(&secs) help!!!

    seconds...thats why it says time

  4. #4
    Join Date
    Feb 2002
    Posts
    4,640

    Re: C++ Allegro - time(&secs) help!!!

    What I meant is, what is it's type? It's not a 'time_t'.

    Viggy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured