[英]reading from a json file using fscanf() in c
我想知道是否有人可以解釋為什么它正在讀取零以及如何修復它
#include <stdio.h>
int main(void) {
FILE* f = fopen("text.json","r");
int l,x=0;
fscanf(f,"%d %d ",&l,&x);
printf("%d %d ",l,x);
return 0;
}
我的文本.json:
[ 1, 2, 3, 4 ]
運行時會打印兩個 0。 我真的不明白為什么或如何讓它打印數字。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.