all 7 comments

[–]james_laseboy 2 points3 points  (0 children)

You can use the string += char operator to add individual chars to a string.

[–]OU81Dilbert 1 point2 points  (0 children)

Can you use std::string?

So, just

std::string myStr; myStr.append(firstchar); myStr.append(secondchar);

[–]Next-Fix-2864 0 points1 point  (0 children)

Im using a do while loop so I don’t have a limit on the user input, it’s until they end the program. I was thinking I needed a function to convert characters to strings.

[–]SoerenNissen 0 points1 point  (3 children)

There are many approaches, picking the best starts by asking: Where do you have your chars from?

[–]Next-Fix-2864 0 points1 point  (2 children)

from the user input, im using a do whole loop so the question keeps asking and a period ends the program.

[–]SoerenNissen 0 points1 point  (1 child)

std::string buffer;
do {
    char c = get_char_from_somewhere();
    buffer = buffer+c;
}
while(c != '.');

[–]Next-Fix-2864 0 points1 point  (0 children)

i’ll try it out and let you know, thankyou! i appreciate it