On some Pi's the serial port is /dev/ttyS0, on others it is /dev/ttyAMA0, if you are using a USB adaptor it becomes /dev/ttyUSB0, this is not an exhaustive list.
At the BaSH prompt you can type
echo -en "my text\n" > /dev/ttys0 ## write to serial
cat /dev/ttyS0 ## read from serial
In C you can
#include <stdio.h>
char reply[32] = {0}; // response storage
FILE* fd = fopen("/dev/ttyS0", "r+"); // open Serial
fprintf(fd, "request\n"); // write serial
fread(reply, sizeof(char), sizeof(reply) -1, fd); // read serial
printf("response: %s\n", reply); // display result
fclose(fd); // close serial