Hey, I am trying to write a string called pathSegment using an int(pathNumber) followed by a char(pathLetter)
For example, if pathNumber is 12 and pathLetter is e, pathSegment is 12e.
However, I am not sure how to make this happen.
This is what i have right now
string PathSegment(int pathNumber, char pathLetter);
I also have the qualifications that pathNumber is two digits and pathLetter is a cardinal direction, lowercase or uppercase. Sorry I am relatively new to C++ and this is pretty complicated for me so I may have made one(or more) simple mistakes.
When I call pathSegment in my main function, I get a weird symbol instead of 12e
That's because pathNumber << pathLetter does a bitwise left shift on pathNumber the number of times pathLetter is equal to as an integer. It sounds kind of like you want to use a stringstream for pathSegment here, at which point you can put those values into it like cout.