A string consisting of letters and digits. How do you do that? How do you code that?

Recommended Answers

All 4 Replies

std::string myString = "A string consisting of letters, ABC, and digits, 123"

Or did you mean something more like this:

std::string myString = "ABC";
myString + " 123";
std::cout << myString << std::endl;

I think you'll have to clarify...

The digits and letters are both chars in a string. :)
The chars are held together by an array.

Fbody, your line 2 should read myString += " 123"; I believe.

Fbody, your line 2 should read myString += " 123"; I believe.

Oops :$ Busted......

Thanks, jonsca, you're right.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.