user3225339
user3225339

Reputation: 11

fprintf variable or string

I think I might be digging into this too deep but I am curious if there really is any difference between using fprintf with a variable or not? Other than the memory usage of x in this case.

fprintf(stderr,"%d", 1);

vs

int x = 1;

fprintf(stderr,"%d", x);

Upvotes: 1

Views: 241

Answers (1)

dbush
dbush

Reputation: 224457

There's no difference. Both x and 1 are of type int, so there is no difference between the two as far as printf is concerned.

Upvotes: 3

Related Questions