Wow I never thought of calling a function within the nested loops. Cool. Thanks for that idea! That .. gives me a lot of room. I don't have to try to cram all my into a buncha loops--makes the syntax much easier to read and think through. Way cool.
And.. this string stream.. I've NEVer heard of them. After reading up on it, I realized why it helps me do exactly what I want. Thanks! How did you find out about this? I found it here:
http://www.cplusplus.com/reference/iostream/ but that's because I was looking for it. Did you just find it one day or read it in a text you bought?
I initially saw that data type and replaced it with 'string' since I was familiar with that. It worked except for when I wanted to append the integer to the end of the string--kept on getting cool symbols.
my code changed 's' to a string type. Then I tried doing this:
1 2
|
s+=pc->value;
return s;
|
I suppose this is true because it was converting pc->value into a string.. reading it as an ASCII value?
That's when I decided there was a reason why you used stringstream. Then I learned about them :D. Yay.
You've been a great help! Thanks!
EDIT: I saw the link you added in your "edit". Thanks for the info.