Mail Archives: djgpp/1998/06/29/12:08:06
On Mon, 29 Jun 1998 13:34:49 +0200 "Daniel Fauré" <dano AT dynaguy DOT demon DOT nl>
writes:
>>
>>int main()
>>{
>>
>> allegro_init();
>> set_color_depth(8);
>> set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0);
>> text_mode(0);
>> char *c;
>> int p;
>> p=3;
>> itoa(p, c, 10); // call frame traceback here
>>
>> textout(screen, FONT, c, 10, 10, 15); // parse error before ','
>here
>>}
>
>Well... this should be quite obvious, FONT should be font, FONT is the
>struct, used to declare for example the default "font". As for the
>other
>error... I don't get it. This piece of code compiles fine, then
>displays "3"
>and returns to my IDE without too much trouble. Sorry, can't help you
>there.
>
>Daniel Faure
>
it should be obvious what the problem is here, c is never initialized, so
it's pointing to some random place (since it's an automatic variable).
generally in protected mode, any efforts to write to c would result in a
crash.
_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]
- Raw text -