Mail Archives: djgpp/1997/07/01/09:59:04
On 1 Jul 1997, DrkWatr wrote:
> frame_skip = atoi (arg_temp[2]);
^^^^^^^^^^^
This should be "&arg_temp[2]" or "arg_temp+2". `atoi' needs a pointer to
a string, whereas arg_temp[2] is the 3rd character of the string, not a
pointer. Dereferencing arg_temp[2] should really crash your program if
you run it on plain DOS (no Windows), since CWSDPMI, the free DPMI server
bundled with DJGPP, aborts any program that attempts to dereference
pointers with obviously bigus values.
> printf ("%s",arg_temp[1]);
Same error here. Either use &arg_temp[1] or arg_temp+1, or replace %s
with %c if you want to print a single character.
- Raw text -