Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

C++, file input

Name: Anonymous 2009-11-26 5:16

Hi /prog/

I got a text file with each line representing an object and it's inherent values.

Formatting goes like this, just as a principle: "OBJECT;<int> a;<std::string> s;\n"

There's a couple of types of objects, all object of the same type has the same format and values.

---

My basic idea to read-in all the different objects is:

while Getline from file

Get "element" from line which goes on until a ';' is encountered

If the (first) element is "OBJECT_B" then we know that we're going to have, for example, string, string, int, long int,... and that's all.

But how do I do this? Help appreciated :)

Name: Anonymous 2009-11-26 5:31

Read SICP

Name: Anonymous 2009-11-26 5:46

Stop using Sepples.

Name: Anonymous 2009-11-26 6:15

Why do we get so many SEPPLES homework threads lately?

Name: ​​​​​​​​​​ 2010-10-21 18:28

Name: ​​​​​​​​​​ 2010-10-23 5:40

Name: Anonymous 2011-02-04 18:05

Don't change these.
Name: Email:
Entire Thread Thread List