I'm new to C++ programming although I'm pretty familiar with programming in general. I have issue relating to strings I've stored. Essentially I have a map defined as follows.
I've added a number of elements to it without any problem. Where I run into problems is after retrieving a value and trying to use the string like so.Code:map<string, string> resources;
This is a simplified version of my code but it illustrates the problem. If s1 = "1280" and I concatenate s2 onto it I will get the following output "x280" instead of "1280x".Code:string s1(resources["width"]); string s2("x"); s1 += s2; cout << s1 << endl;
What am I doing wrong? Thanks.