📄 ch08-getcwd.c
字号:
/* ch08-getcwd.c --- demonstrate getcwd(). Error checking omitted for brevity */#include <stdio.h>#include <fcntl.h>#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>int main(void){ char buf[BUFSIZ]; char *cp; cp = getcwd(buf, sizeof(buf)); printf("Current dir: %s\n", buf); printf("Changing to ..\n"); chdir(".."); /* `cd ..' */ cp = getcwd(buf, sizeof(buf)); printf("Current dir is now: %s\n", buf); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -