Tag:

如何在c中剪切一部分字符串?

我正在试图弄清楚如何在C中切割一部分字符串。例如,你有这个字符串“狗因为一辆车在过马路时撞到了他而死了”一个函数如何制作句子“a过马路时撞到了他的车“或”一辆车撞到了他“ 你如何使用C的库(或/和)自定义函数来解决这个问题? 好吧,我没有主要代码,但这将是这个实验的结构 #include #include #include #include #include #include #include “display_usage.c”/*If the user enters wrong arguments it will tell them how it should be */ void cut( const char *file, int option, int first, int last ); int main(int argc, char *argv[] ) { FILE *fp; char ch; fp = fopen(“test.txt”, “r”); // Open file […]