-
October 23rd, 2009, 10:58 AM
#1
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
-
October 23rd, 2009, 11:27 AM
#2
Re: C++ Allegro - time(&secs) help!!!
-
October 24th, 2009, 04:24 AM
#3
Re: C++ Allegro - time(&secs) help!!!
seconds...thats why it says time
-
October 27th, 2009, 12:09 PM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|