Mail Archives: djgpp/1997/11/08/17:16:20
Tron wrote:
[Snip]
>examples:
>
> char Buffer[100];
> int Inteiro;
> char Rest_of_Buffer[60];
>
> void main(void)
> {
> sscanf(Buffer, "%s %d %[^\n]", First_arg, Inteiro, Rest_of_Buffer);
The Inteiro variable needs to be prefixed with & in order for the variable
to be accessed by the scanf function. So the line becomes:
sscanf(Buffer, "%s %d %[^\n]", First_arg, &Inteiro, Rest_of_Buffer);
The scanf functions require pointers to scalar variables in order to access
them.
> }
[snip]
>
>sscanf, scanf and fscanf, they are very powerfull functions... special for
>shells and parsing...
>
Very true.
Cheers
John
________________________________________________________________
Parallax Solutions Ltd. Tel.: 01203 514522
Stonecourt, Fax.: 01203 514401
Siskin Drive, Web : http://www.parallax.co.uk/~johne
Coventry CV3 4FJ Mail: johne AT parallax DOT co DOT uk
________________________________________________________________
Remember:
There is no such thing as computer error, it's 100% YOUR fault
________________________________________________________________
- Raw text -