Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ideas for Loading Data from a File Into Templated Class Object

Status
Not open for further replies.

Zaid

Programmer
Jul 21, 2000
6
CA
I'm trying to write a function that loads data from a file into a templated class object. This is tricky because the fucntion has to ensure that the data in the file can be read in as the data type of the object.<br><br>i.e. If the file contains:<br>1<br>22<br>333<br><br>how can I get the function to recognize that those are integers, yet still work if the file contains characters?<br><br>I'm just looking for ideas.
 
If you're trying to read from a file.&nbsp;&nbsp;You should have some specifications for that file.&nbsp;&nbsp;Otherwise it's a coding nightmare.<br><br>eg.&nbsp;&nbsp;if it's an import delimited by &quot;;&quot;<br>12;123;1234<br><br><br>You can read between the semicolons for and then convert the strings to numbers.<br><br>Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top