mohican | Generalized database managment interface | SQL Database library
kandi X-RAY | mohican Summary
kandi X-RAY | mohican Summary
Generalized database managment interface. This is a collection of independent database managment systems, united by common interface, so it almost does not matter whether you use mongodb, mysql or postgresql.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mohican
mohican Key Features
mohican Examples and Code Snippets
Community Discussions
Trending Discussions on mohican
QUESTION
hello folks im still a beginner to c++ so i apologize in advance. okay so some context is this is a hw assignment for my class we have to make a an array that holds all the books that are being read in from the a txt file then organize them by hashing. the part that im stuck on is reading in the data i cant seem to get it right. the error occurs in load table function, it reads the first line and i put the cout stuff under it to test it out and it does print the first book out but after it throws a invalid argument error.
Input file:
...ANSWER
Answered 2017-Jul-07 at 16:03The error on the 2nd line happens because the last field of the row doesn't have #
after it. So the last getline()
should use '\n'
as the delimiter, not '#'
.
When this is fixe, you get an error is happening after reading the last line, because you're using while (!myfile.eof())
. The EOF condition isn't set until after you try to read the file at the end, as explained in Why is iostream::eof inside a loop condition considered wrong?. So it's reading an empty line, then trying to parse it as a number. You should put the first getline()
call in the while()
condition.
The corrected program is:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install mohican
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page