In embedded C, i use printf which redirects to the system call "_write" which allows my to overload _write and redirect to Uart or Usb VCP.
Now in embedded C++ i would like to do the same for std streams std::cout std::cin.
Where do the calls lead to? where do i end up when calling cout/cin?? is there also a system call which i may overload?
printf("hi") --> _write() std::cout << "hi" --> ???????????? Since i cannot debug standart library calls, i do not know what happens there.
if someone has experience with this, please give me some examples and tipps.
iostreaminternally usesstdio.h. The system call should be as same, i.e.write(2). Usestracecommand if you want to see all system call.writeand then changecout.rdbufto that.