I was wondering if someone could explain why it is reading zeros and how to fix it
#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;
}
my text.json:
[ 1, 2, 3, 4 ]
when run this prints two 0s. I don't really understand why or how I would make it print numbers.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.