Accessing Sub Strings

If I have an array of type string, and each of its element is made up of multiple sub strings as well (e.g. I have an array of a deck of cards and its individual elements are "Ace of Spades", "Queen of Diamonds", etc), would it be possible to access just a part of an individual element (e.g "Ace" or "Queen" etc)?

Sure. Use string::find_first_of() to locate the space between words.
Then use string::substr() to extract the portion you want.
http://www.cplusplus.com/reference/string/string/find_first_of/
http://www.cplusplus.com/reference/string/string/substr/
Topic archived. No new replies allowed.