#include #include int main(){ int flag = O_CREAT; printf("O_CREAT is 0x%x\n", flag); // Set a flag to true flag |= O_RDWR; printf("After setting O_RDWR, flag = %d\n", flag); // Check to see if O_CREAT is set if(flag & O_CREAT){ printf("O_CREAT is set\n"); } // Set a O_CREAT to false flag &= ~O_CREAT; // Check to see if O_CREAT is not set if(!(flag & O_CREAT)){ printf("O_CREAT is not set\n"); } // open("filename", create if it doesn't exist, open read/write, truncate if it exists) }