When I use this code:
#include <stdio.h>
#define STR(x) #x
int main(void)
{
printf(__FILE__ STR(__LINE__) "hello!\n");
return 0;
}
it prints
hello.c__LINE__hello!
but when I use this:
#include <stdio.h>
#define STR(x) VAL(x)
#define VAL(x) #x
int main(void)
{
printf(__FILE__ STR(__LINE__) "hello!\n");
return 0;
}
it prints
hello.c7hello!
what's the difference between
#define STR(x) #x
and
#define STR(x) VAL(x)
#define VAL(x) #x
The best macros for fat loss According to McMaster University research, a 5 : 3.5 : 1.5 ratio of carbs, protein and fat (when coupled with doing a four-week workout programme) can deliver healthy fat loss results. And in fact, perhaps better results than when reducing carbs and increasing protein.
Carbohydrates, fat and protein are called macronutrients. They are the nutrients you use in the largest amounts.
Work out how many grams of each macro you need to eat To work out how many grams of each you need, you multiply your total daily calories by 0.4 for protein and 0.3 for carbohydrates and fat. The protein and carbohydrate figures are then divided by 4 and the fat figure by 9.
The acceptable macronutrient distribution ranges (AMDR) set forth by the Institute of Medicine of the National Academies recommend that people get (26): 45–65% of their calories from carbs. 20–35% of their calories from fats. 10–35% of their calories from proteins.
Arguments to macros are themselves macro-expanded, except where the macro argument name appears in the macro body with the stringifier # or the token-paster ##.
In the first case, the argument of STR is not macro-expanded, and so you just get the name of the LINE macro.
In the second case, the argument of STR is macro-expanded when it is substituted into the definition of VAL, and so it works -- you get the actual line number because the LINE macro is expanded.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With