Main-elipse -vector-arrays in cpp , C/C++ Programming

Unlike C++, other programming languages have associative arrays that allow array indices to be strings instead of just integers. You are to create a template class, SVector, that implements a constructor, push_back, [], and pop_back, with STL strings as indices. push_back() takes two parameters, first the index string, and second the value stored. You will store the value in an STL vector, and use an STL map to provide a mapping between the STL string indices and their corresponding integer indices. Since the map will always contain a string and int you should typedef it.

1. main(). Your main() will be quite long because it is the only function in main.cpp. 1.1. All exceptions should be caught and reported in main() relying on printing the value returned by what().

1.2. You must specify the exact exception you are catching, and may not use the elipse (...) in your catch.

1.3. You should declare a pointer to a SVector of type so that you can call its constructor within a try-catch statement and still have scope for the whole main function.

 

Posted Date: 3/6/2013 2:49:03 AM | Location : United States







Related Discussions:- Main-elipse -vector-arrays in cpp , Assignment Help, Ask Question on Main-elipse -vector-arrays in cpp , Get Answer, Expert's Help, Main-elipse -vector-arrays in cpp Discussions

Write discussion on Main-elipse -vector-arrays in cpp
Your posts are moderated
Related Questions

ABC Car Dealership needs your help to update the ordering system. This car dealer is selling four types of vehicles: Sedan, Truck, SUV, and mini Van. And each type of vehicle can h

THEORY OF COMPUTER PROGRAMMING

#question.to determine the area of a triangle,rectangle and trapezium

#write a program that counts the number of occurances of the string in the n-th padovan string p(n)

Exceptions. Your SVector class should throw four exceptions: 3.1. If the constructor size is invalid, then it will just allow the implicit STL bad_alloc exception to pass up to mai

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. #include float start_point,

how to do 2, 4, 8 associativity

Reference Types The symbol "&" is interpreted as an address operator as well as AND operator. This operator is also used to declare a "reference variable". A reference is refer

#questAt a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets wit