Mail Archives: djgpp/1999/09/18/16:29:12
Manni Heumann wrote:
>
> 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);
> >}
[snip]
>
> 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
I see,As i am still quite new to C/C++ i hadnt figured this out
yet.Thanks for pointing this out to me.
Be Cool,
Krogg.
--
|"""""<`.THE PRINCE ,'>"""""""""""""""""""""""""""""""""""|
| `.`/""""""\,',' my sig is too big, |
|SEE HIS ( / \ \' SEE HIS but its really cool. |
| FACE \/<> <>\/ SMILE |
| / W \ Visit my ascii art site: |
| ,'\_|||||_/`. http://www.gtcom.net/~krogg/ascii/ |
| ,',' ||| `.`. krogg DOT no DOT to DOT spam AT gtcom DOT net |
|____<,' TIME TO DIE `.>____Remove no.to.spam to reply____|
- Raw text -