Hi.
Is it easy to read from and write to the com port using C++? Is there a library for it?
Thanks,
Kuphryn
Is it easy to read from and write to the com port using C++? Is there a library for it?
Thanks,
Kuphryn
I don't think it's any more silly than using bare line feeds or bare carriage returns.Win32, because of a silly design decision
The problem is with ASCII; using anything other than a CRLF pair would be dumb.I think it is stupid because they used two characters instead of one. This leads to the same problem unicode was designed to solve: with multibyte characters you can't tell the length of a string (c style, that is) without actually walking the entire array. Dumb as hell.
I'm not entirely sure where this would be an issue; the Nth character is at offset N-1, always. I guess I've never come across a situation where I want to change the character that's N-places-assuming-that-CRLF-pairs-are-elided-into-a-single-character (normally I'd work with offsets that were correct no matter what, e.g. as returned by a find function, or I'm working on lines at a time and so have no embedded newlines). I'm not really seeing why I'd want to, either.Originally posted by earl:
OK, bad example. I have a large buffer. I want to modify character N. With ASCII and two character line terminators, I have to walk all characters < N and potentially up to 2N to see where exactly in my array the Nth is.