I'm using the following guide as a reference for reading and writing to a modem via a serial port:

Serial Programming Guide for POSIX Operating Systems

So far based on what I read, I have a program that looks like this:

Code:
#include <stdio.h>   /* Standard input/output definitions */
#include <string.h>  /* String function definitions */
#include <unistd.h>  /* UNIX standard function definitions */
#include <fcntl.h>   /* File control definitions */
#include <errno.h>   /* Error number definitions */
#include <termios.h> /* POSIX terminal control definitions */


struct termios options;

int open_port()
{
    int fd; /* File descriptor for the port */
    fd = open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY);

    if (fd == -1)
    {
        perror("open_port: Unable to open /dev/ttyS0 - ");
    } else {
      fcntl(fd, F_SETFL, 0);
      return (fd);
    }
}

int configure_port(int fd)
{
    cfsetispeed(&options, B1200);
    cfsetospeed(&options, B1200);

    options.c_cflag |= (CLOCAL | CREAD);

    options.c_cflag &= ~CSIZE; /* Mask the character size bits */
    options.c_cflag |= CS8;    /* Select 8 data bits */

    tcsetattr(fd, TCSANOW, &options);

    return 1;
}

int main(void)
{
    int fd = open_port();
    configure_port(fd);

    return 0;
}
In the section "Setting the Character Size", it says "you must do a little bitmasking to set things up. The character size is specified in bits".

Now I am familiar with the bitwise operators, but still I cannot make sense of what's going on here. c_cflag is a member of a struct, and we take CSIZE (which printf says its value is 48, which is binary 0011 0000) and use the one's complement ~ to get 1100 1111. And then we use a bitwise AND "&=" with the c_cflag member. But wait a second, c_cflag is a member that holds many options, not just the character size, so why exactly are we assigning it the value 1100 1111?