gpt4 book ai didi

c - 用c中的字符串替换文件路径的一部分

转载 作者:行者123 更新时间:2023-11-30 21:11:18 25 4
gpt4 key购买 nike

FILE *fptr1;
char str[10];

fptr1=fopen("D:\\New Folder\\test.txt","rb")
//Now I want to replace text.txt with my string.Just want to know the syntax :/

最佳答案

没有这样的方法可以直接编辑 fptr1 包含的内容。

FILE *fptr1;
char str[10];
//char fileName[50] = "test.txt";
char path[500] = strcat("D:\\New Folder\\","test.txt");
fptr1=fopen(path,"rb");

关于c - 用c中的字符串替换文件路径的一部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24523445/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com