BS> I need implement method which should read a string from configuratio
BS> and return a part og this string, such as:
BS> "Server port number: 101"
BS> method should return "101".
Copy and Paste is the most effective programming method :-)
So let's look at how streams do it:
istream &istream::getline(char *, int, char = '\n');
If you change your function to
void IniFile::readline(char *buf, int buflen)
the caller has to provide the string.
A better idea might be not to use character arrays but the standard
string class:
string IniFile::readline()
Thomas
---
þ MM 1.0 #0113 þ Spaghetti code means job security.
---------------
* Origin: McMeier & Son BBS (2:301/138)
|