If value_str does not change until the line containing fwrite, then fp_to_str must be returning NULL (since the pointer was initialized to NULL and you report that that value doesn't change). Is NULL a valid return value from fp_to_str, or might that indicate an error?
num will be equal to strLength here, which makes me think you're not sure as to what you're doing. (What are you doing?) You've add the value 10 (Magic constant - is this a newline? Use '\n') to the space after the null terminator. Your string is:
发布评论
评论(2)
如果
value_str
在包含fwrite
的行之前都没有改变,那么fp_to_str
必须返回NULL
(因为指针是初始化为NULL
并且您报告该值没有更改)。NULL
是fp_to_str
的有效返回值,还是可能表示错误?If
value_str
does not change until the line containingfwrite
, thenfp_to_str
must be returningNULL
(since the pointer was initialized toNULL
and you report that that value doesn't change). IsNULL
a valid return value fromfp_to_str
, or might that indicate an error?除了 Adrian McCarthy 所说的之外:
这里
num
将等于strLength
,这让我认为您不确定自己在做什么。 (你在做什么?)你已将值10
(魔法常量 - 这是换行符吗?使用“\n”)添加到空终止符之后的空格中。你的字符串是:In addition to what Adrian McCarthy said:
num
will be equal tostrLength
here, which makes me think you're not sure as to what you're doing. (What are you doing?) You've add the value10
(Magic constant - is this a newline? Use '\n') to the space after the null terminator. Your string is: