does anyone know if it possible to have something like
#DEFINE NUM_DEC 4
printf("This is your value:%.NUM_DECf\n");
thanks in advance
Its impossible because anything other than data type specifiers and escape characters within double quotes of printf function is treated as string or character constant and is printed as it is in output.
I believe, your real requirement, is to set variable precision for your floating point number.
The bad news is you can't do it that way.
The good news is there is another way. printf("This is your value:%.*f", 4, 22./7); Follow the link to know how it works
Or are you looking for something like this?
#define st "String 2"
int main ()
printf("Str 1 "st);//equivalent to printf("str 1 %s", st)
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...