Mail Archives: djgpp/1999/09/17/18:23:11
In article <37E294DB DOT 87A9535D AT gtcom DOT net>, krogg DOT no DOT to DOT spam AT gtcom DOT net wrote:
>Varence wrote:
>>
>> Also, try declaring BITMAP *buffer at the head of the
>> function, and buffer = create_bitmap(1024,768) after. If
>> you have other instructions prior to this, rather than just
>> declarations, your compiler might be spewing.
>>
>If i understand you correctly
>then you are saying do this:
>
>BITMAP *buffer;
>int main(void)
>{
> buffer=create_bitmap(1024,768);
>}
>
>instead of doing this:
>
>int main(void)
>{
>BITMAP *buffer=create_bitmap(1024,768);
>}
>
>OK,I tried it and it worked great.I dont understand why
>but I will think about it a while and see if i can.Thanks,
>my program looks nice in double buffering.
>
>
No, he meant:
int main (void)
{
BITMAP *buffer;
do_some_other_stuff();
}
instead of:
int main (void)
{
do_some_stuff();
BITMAP *buffer;
}
This is one of the differences between C and C++. In C you cannot create
variables anywhere you want to, C++ has serious reasons to allow this.
--
Manni
- Raw text -