Uhhh

Posts 1–6 of 6 · Page 1 of 1
Uhhh
In my C++ book one of the assignments is to Create a program that Searches for a '-' (hyphen) in a string and replaces it with a '_' (underscore). People have told me to use arrays. But i dont know how itd apply to it /

What'd i have to do?

And whats Primitive Hash Code? /
Would it work in an Entered in string?
such as
std::cin >> string_1; ?
Of course i think it would work. Test it, than you know it ;-)

Regards
1. create a char array
2. fill it with a text with a hyphen in it
3. scan for the hyphen
if you found it replace it.
stop scanning when the array ends

if you need more tips ask for them.
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us