在使用linux (读、写)与文件系统交互时,使用向量(向量无符号字符)代替字符数组(char [])有多安全和正确?需要建设性的批评。还有其他选择吗?written to test the possibility of using a vector as a buffer#include <vector>
#include <fcntl.h> /
在父进程中,我需要派生原始进程,现在当前父进程将3读入主进程中使用的fd,并写入新创建的子进程,这将经历前一个子进程所经历的过程。if (pid > 0){ //parent which writes n to fd for (j = 2; j <= n; j++){
if (write(fd[1], &j, sizeof(int)) == -1){ /