赞
踩
目录
yum install openssh-server #安装 service sshd status #查看状态
# 安装g++ 要用root权限运行 yum install gcc-c++ g++ -v #查看版本
yum install gdb #安装 gdb -v #查看版本
yum install cmake #安装 cmake --version #查看版本 make --version #查看版本
- Remote -Containers
- Remote -SSH
- Remote -SSH:Editing Configuration Files
- Remote -WSL
- Remote -Containers
- 选择平台(这里选择linux),输入连接运存服务器的密码进行连接。
- 创建文件夹,获取路径
- 打开文件夹
- hello.txt
This is a test!
- main.cpp
#include <iostream> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> int main(int ,char**){ int fd = open("../hello.txt", O_RDWR); if (-1 == fd){ std::cerr << "erro \n" ; return -1; } for(;;){ char buffer[1024] = {}; ssize_t len = read(fd, buffer, sizeof(buffer)); if(0 == len){ break; } buffer[len] = '\0'; std::cout << buffer << std::endl; } close(fd); return 0; }
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。