[solved] Ubuntu C++ <--> Mega2560 Serial Communication

It really is dead easy you know!

It's as simple as this - the serial ports (both in windows and *nix) may be read using the very same interface used to read files.

So, all you need to do is call fopen with the name of the serial port device as the filename.
You then read/write from/to the 'file'. It's a 27 line program to provide a dodgy read-only 'Serial Monitor' like the one in the arduino ide.

Here's the first 11 lines of something I threw together. You'll be fine from here. If you can read from a disk file, serial ports are just as easy to get started with.
If not, research how to read from a file.
Just make sure you change the serialPortFilename to reflect the port you're actually connected to (you can see it in the bottom right corner of the arduino ide, in the status-bar)

#include <stdio.h>
#include <string.h>

char serialPortFilename[] = "/dev/ttyACM0";

int main()
{
    char readBuffer[1024];
    int numBytesRead;

    FILE *serPort = fopen(serialPortFilename, "rwb");