I am reading in two integers from a file.  For example my input.txt file has the integers : “4–5” I am able to open the file and store the first value (4) into variable n but I can't store the second integer value (5) into variable m, I think the computer reads the dash as the next integer instead of the actual integer which is 5, how can I create a code that ignores the dash when searching for the integer in the input.txt? Thank you

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 6PE
icon
Related questions
Topic Video
Question
100%

Good day/evening , C++ help needed.

I am reading in two integers from a file. 

For example my input.txt file has the integers : “4–5”

I am able to open the file and store the first value (4) into variable n but I can't store the second integer value (5) into variable m, I think the computer reads the dash as the next integer instead of the actual integer which is 5, how can I create a code that ignores the dash when searching for the integer in the input.txt? Thank you 

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT