Explanation for sprintf(“%03d”, 7) functionality??

I am trying to write functions in R where the aim is to read multiple .csv files. They are named as 001.csv, 002.csv...

what do these symbolic strings mean: %02d %01d??

I'm looking at a code line similar to: sprintf(buffer,"%02d:%02d:%02d",hour,minute,second); I think the symbolic ...

How to add zeros after the significant digits after decimal in C??

double r; float a; scanf("%lf",&r); a=M_PI*pow(r,2); printf("%.*f",6,a); The output is 12.566371 but I want th...

Using floats with sprintf() in embedded C?

Guys, I want to know if float variables can be used in sprintf() function. Like, if we write: sprintf(str,"adc_rea...

How can I print a string to the console at specific coordinates in C++??

I'm trying to print characters in the console at specified coordinates. Up to now I have been using the very ugly pr...

how to write an integer to a file (the difference between fprintf and fwrite)?

I've been trying to write an integer to a file (open mode is w). fprintf wrote it correctly but fwrite wrote gibberi...

Problem with System.out.printf command in Java?

I am new to programming so I apologize beforehand. I am running a program and am having a problem with the System.o...

How do you allow spaces to be entered using scanf??

Using the following code: char *name = malloc(sizeof(char) + 256); printf("What is your name? "); scanf("%s", nam...

What is the argument for printf that formats a long??

The printf function takes an argument type, such as %d or %i for a signed int. However, I don't see anything for a l...

error: aggregate value used where an integer was expected?

I am having following union union data { uint64_t val; struct{ .... } }; and I have a functio...

How to repeat a char using printf??

I'd like to do something like printf("?", count, char) to repeat a character count times. What is the right format-...

Explanation for sprintf(“%03d”, 7) functionality??

I am trying to write functions in R where the aim is to read multiple .csv files. They are named as 001.csv, 002.csv...

what do these symbolic strings mean: %02d %01d??

I'm looking at a code line similar to: sprintf(buffer,"%02d:%02d:%02d",hour,minute,second); I think the symbolic ...

C's printf and fprintf(stdout,) are not printing?

This is a bit of an odd one. My code wasn't outputting what I thought it should. I added some print statements at va...

stack around the variable…was corrupted?

I have a simple function that writes some data to a new file. It works, and the file is written, but I get the above...