Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New line but no carriage return #11

Closed
CvRXX opened this issue Jun 26, 2018 · 1 comment
Closed

New line but no carriage return #11

CvRXX opened this issue Jun 26, 2018 · 1 comment

Comments

@CvRXX
Copy link
Contributor

CvRXX commented Jun 26, 2018

constexpr char endl = '\n';

The \n in the above line does not do a carriage return in most Linux serial viewers. I think an \r should be added but then it's not a single char anymore.

@wovo
Copy link
Owner

wovo commented Aug 28, 2021

from https://www.cplusplus.com/reference/ostream/endl/ :

Its behavior is equivalent to calling os.put('\n') (or os.put(os.widen('\n')) for character types other than char), and then os.flush().

Currently the ostream is not buffered, so the flush part can be ignored.

The real problem is that '\n' is supposed to send or , depending on the conventions of the host, that is, the platform the code is running on. So there is no obligation to do either way.

@wovo wovo closed this as completed Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants