I read a line from a file as a string, and I want to replace the spaces with '*'. I'm doing this because I think the functions in the find family, string::find, might have issues with recognizing spaces. It knows a space is a position in the string, but it doesn't recognize it as a character. So if I compare it against a character, I get in accurate results.
I'm doing this because I think the functions in the find family, string::find, might have issues with recognizing spaces. It knows a space is a position in the string, but it doesn't recognize it as a character. So if I compare it against a character, I get in accurate results.
This is not true at all. Do you have an example program where spaces cause an issue but other characters don't?
Well I understood string::find_first_not_of description as saying that the second input in the () was the position the function starts to do it thing. It compares '-' to whatever is in and after the position you specify. I tried both and stepped through it. x[i] + 1 has been working.
string::find_first_of is an odd choice for finding a single character.
Your code seems overly complicated. DummyVariable, DummyVariable1... really?
Yeah, those were for debugging. I was having trouble figuring out when and if I should use x[i] + 1 or x[i+1].
Are you trying to achieve something like the following?
I was trying to do something I thought was simple at first. Count what's called a complex rung in old school ladder logic. I extract code from old school DOS machines and a task that takes forever is counting these rungs. Especially when you have thousands and thousands of networks. So far the counter code gets me really close, but there are exceptions. Right now I'm trying to get ride of those exceptions. But who knows if that's possible.
there should have been "==" instead of just "=". So the counter now works just fine. I added a few capabilities. I'm now starting on a GUI. It seems like i'll be going with QT for C++ since it's free and there are plenty of tutorials on youtube for it.