#include #include #include #include #include #include using namespace std; int main(int argc, char * argv[]) { int fd; int flags; int i; //char c; string filename{"output"}; if (argc > 1) { filename = argv[1]; } mode_t mode; flags = O_WRONLY | O_TRUNC | O_CREAT; mode = S_IRUSR | S_IWUSR | S_IROTH | S_IRGRP; fd = open(filename.c_str(),flags, mode); for(i = 65; i < 75 ; i++) { write(fd, &i, sizeof(int)); // c = 'a' + i; // write(fd, &c, sizeof(char)); } close(fd); return 0; }