Question: I am doing this on C++ How would I put the contents of this file it into a string? The file contains lines of either

I am doing this on C++

How would I put the contents of this file it into a string?

The file contains lines of either a Roman Numeral or an Arabic Numeral

The lines should follow this format :

Roman numeral field 15 characters -

Arabic numeral field 4 characters

If a line only contains a Roman Numeral it needs to be converted into an Arabic Numeral and vice versa( I have already done this part)

My question is how would I put a Roman Numeral or an Arabic numeral from the file and into a string variable without taking in the rest of the blank space of the line?

Eg: Line from program:" 123 "

What I want in a string variable "123"

Line from program:" XXVII "

What I want in a string variable "XXVII"

File input begins:

XXVII

123

MCLXV

1975

File input ends

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!