?? file.cc
字號(hào):
#include <iostream>using namespace std;#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include <cstring>int main(){ char* username = getlogin(); if(strcmp(username,"openlab")==0){ cout << "別搗亂啦" << endl; return 0; } int fd = open("luck",O_WRONLY|O_CREAT|O_EXCL, 0644); if(fd<0){ cout << "失敗!" << endl; return -1; } cout << "成功!" << endl; write(fd, username, strlen(username)); close(fd);}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -