[LC++]overloading operator[]

Julien Patrick Claassen julien at c-lab.de
Wed Aug 29 22:38:03 UTC 2001


Hello all!
  I wrote a small class for handling a specific config-file and that class
should have a special operator[]. It should look like:
  char* config_table::operator [] (char *field_name);
  This operator should return a pointer to the field named field_name. The
complete file is stored in a string. The file has a constant size and the
elements, fields, have a constant position, but the position is a bit
weird and I don't take all fields, so I decided to get the fields by name.
For that reason I would apreciate it to have an operator[] like that. Can
I do so? Or if not, which other, really good and convenent way can I
choose.
  Thanks for all helpful answers!
  My kindest regards
         Julien

Julien Patrick Claassen
jclaassen at gmx.de
julien at c-lab.de
http://www.geocities.com/jjs_home

SBS C-LAB
Fuerstenallee 11
33102 Paderborn

Phone: (+49) 5251 60 6060
Fax: (+49) 5251 60 6065

www.c-lab.de




More information about the tuxCPProgramming mailing list