[LC++]scanning files

Julien Claassen julien at c-lab.de
Mon Sep 27 20:32:01 UTC 2004


Hi all!
  I have a simple probelm, but seem to be completely stupid. I have a file, 
with a simple format, imagine that:
  Filename is myfile.cfg
   Entry in this file is:
  directory = /usr/share/something
  Now I want to read this in a variable. With c I would have done:
  ...
  fscanf(file_pointer,"directory = %s",&my_string);
  ...
  How would I do this with c++ in an ellegant manner? I thought of 
stringstreams, but well... I'm completely lost...
  Any help is appreciated and greatfully taken!
   Kindest regards
      Julien

--------
Music was my first love and it will be my last (John Miles)

======== FIND MY WEB-PROJECT AT: ========
http://ltsb.sourceforge.net - the Linux TextBased Studio guide




More information about the tuxCPProgramming mailing list