[DGD] sscanf direction

Robert Forshaw iouswuoibev at hotmail.com
Mon Jan 12 20:16:32 CET 2004


I have a question about sscanf (and yes I did check the archives, I don't 
think the answer was there...), which I think is to do with the direction in 
which the pattern is processed. For instance, if I wanted to strip the 
filename from the end of a pathname string, would I do this?:

string path;

path = "/some/path/file.c";

sscanf(path, "%s/%*s, path);



Or would that set path to "path/file.c" ? If so, how would I make it do it 
the other way around (set it to "/some/path/" ? If it does do that, how 
would I make it do the other effect (set it to "path/file.c") ? I hope that 
makes sense...

_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list