C and C++ serial connection

Hi, I’m trying to link my Arduino uno R3 to a c or c++ application by a serial connection on Linux Slackware. I can’t find a functional example online.
Can anyone tell me where to find one example for c and one for c++?
I’m able to use python but i prefer c/c++ languages.


I can't find a functional example online.

You didn't look hard enough, then.

Arduino Playground - HomePage has sections for Arduino + C, C++, etc. once you get past all the spam.

If one of those links doesn't do what you want, detail which one and the problems you have. Then, we can do something about the link.

Well, I forget to say “without external libraries”!! But now I assume using libraries it’s the best way and I’m going to try those examples!

Thank you!

Well, I forget to say “without external libraries”!!

That’s a different story. Native support for com ports is not a feature of C or C++.

Ok now I understand why I couldn't find anything LOL :smiley:

you can try to open the file with the device name e.g. "/dev/tty" . small chance but worth the try... (all disclaimers apply)

I tried this morning with "cat /dev/ttyACM0" and it works.. But i wanted something more "professional"! Right now I'm experiencing problems trying to compile libserial on my Slackware64...