更新时间:2023-02-11 16:41:06
scanf函数
需要一个指向初始数组的字节,当你正在阅读的字符串。所以不要使用&安培;当你作为参数传递
。 的fscanf(FP,%[^,],名称)
应该工作。
scanf
expects a pointer to initial byte of an array, when you are reading a string. So dont use&
when you are passing as an argument. fscanf(fp, "%[^,]", name)
should work.
名称
将在离pression使用时转换为指针。
name
will be converted to a pointer when used in an expression.
http://pubs.opengroup.org/onlinepubs/009695399/functions/ fscanf.html