Working with files in cpp, C/C++ Programming

Operation Files 2.1. Your program should open and read the file specified by the first command line argument of the program.

2.2. The first line of the file contains an integer that indicates the size with which to construct the SVector. Your program should catch the STL exception thrown by the STL vector class in main(), and report it before terminating.

2.3. Each line of the file starts with a char. 2.3.1.If the char is a 'U', then there is an integer followed by a string on the line with which to call push_back.

2.3.2.If the char is an 'A', then it is followed by a string with which to access the SVector using []. Your program should print out the corresponding integer, or throw an exception if the string is an invalid index.

2.3.3.If the char is an 'O', then it is followed by nothing. Normally, your main() should print nothing, but it should catch the exception if the vector is empty. Your SVector::pop_back() should update the map so the string to int mapping is removed. This is a little tricky, since you have only the int from the vector size() with which to work.

 

Posted Date: 3/6/2013 2:50:07 AM | Location : United States







Related Discussions:- Working with files in cpp, Assignment Help, Ask Question on Working with files in cpp, Get Answer, Expert's Help, Working with files in cpp Discussions

Write discussion on Working with files in cpp
Your posts are moderated
Related Questions
I can''t figure out how to stop the programming from hitting for the player even when they type in stand.

Write a function for finding out highest and lowest marks obtained by a student from an array contained student name and marks. For Example : GetHighestLowestMarks{Student{n}, Ma

Can copy constructor admit an object of the same class as parameter, rather than reference of the object?

Define some features of register storage class in c program? The feature of variable defined to be of register type all as follows: Storage - CPU registers Default initia

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Write a program that does the following: Calculates the Velocity and Momentum of an object. The formula for the velocity is V=d/t and the formula Momentum is m=mass*velocity. Your

Add guts to VS 2008 C++ windows service Project Description: I have a shell windows32 service written in 2008 VS C++. I want the functionality part started. Need someone too

Does improper inheritance have a potential to wreck a project? Many projects meet a dead end due to bad inheritance. Hence it certainly has potential to wreck a project. Sma

I have to add virtual void calculatePay and virtual void displayEmployee. How to I implement that in Salaried and Hourly Employee?

Define the Relational Operator in c language? The Relational operators refer to the relationships that values can have with one another and they are used to compare two operand