5 years, 1 month ago.

Move to the right column

Hello to everyone. I have my little problems. I can not save data to the SD card. I want to record the left side to the right. not from top to bottom. My code

int b=15; int a=20;

int main() { mkdir("/sd/Sistem", 0777);

FILE *fp = fopen("/sd/Sistem/canbus.csv", "w"); if(fp == NULL) { error("Could not open file for write\n"); }

fprintf(fp, "%d%d \n",a,b); fprintf(fp, "aaaaaaaaaaaaaaaaaaa"); fclose(fp); }

/media/uploads/jafarov/ekran_al-nt-s-.jpg

I want to be like this

/media/uploads/jafarov/ekran2.jpg

how can I do it? The sample code writers you please

1 Answer

5 years, 1 month ago.

You need to seperate your two values, now you print them right after each other. How to do this depends on your country/pc settings. For the US:

fprintf(fp, "%d,%d \n",a,b);

For (mainland?) Europe:

fprintf(fp, "%d;%d \n",a,b);

Accepted Answer

thank you so much Erik. fprintf(fp, "%d;%d \n",a,b); works

posted by nazım jafarov 22 Aug 2016