TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: BOGDAN SHEPTUNOV
from: THOMAS MAEDER
date: 1997-12-26 11:30:00
subject: how should I return point

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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.