#define THIS "this or that"
main()
{
new string[128], rand = random(100);
format(string, sizeof(string), "I like " THIS " a lot also I like the number %d.", rand);
print(string);
format(string, sizeof(string), "I like " THIS " a lot also I like the number %d.", rand);
print(string);
format(string, sizeof(string), "I like " THIS " a lot also I like the number %d.", rand);
print(string);
format(string, sizeof(string), "I like " THIS " a lot also I like the number %d.", rand);
print(string);
format(string, sizeof(string), "I like " THIS " a lot also I like the number %d.", rand);
print(string);
format(string, sizeof(string), "I like " THIS " a lot also I like the number %d.", rand);
print(string);
format(string, sizeof(string), "I like " THIS " a lot also I like the number %d.", rand);
print(string);
format(string, sizeof(string), "I like " THIS " a lot also I like the number %d.", rand);
print(string);
format(string, sizeof(string), "I like " THIS " a lot also I like the number %d.", rand);
print(string);
}
static const THIS[] = "this or that";
main()
{
new string[128], rand = random(100);
format(string, sizeof(string), "I like %s a lot also I like the number %d.", THIS, rand);
print(string);
format(string, sizeof(string), "I like %s a lot also I like the number %d.", THIS, rand);
print(string);
format(string, sizeof(string), "I like %s a lot also I like the number %d.", THIS, rand);
print(string);
format(string, sizeof(string), "I like %s a lot also I like the number %d.", THIS, rand);
print(string);
format(string, sizeof(string), "I like %s a lot also I like the number %d.", THIS, rand);
print(string);
format(string, sizeof(string), "I like %s a lot also I like the number %d.", THIS, rand);
print(string);
format(string, sizeof(string), "I like %s a lot also I like the number %d.", THIS, rand);
print(string);
format(string, sizeof(string), "I like %s a lot also I like the number %d.", THIS, rand);
print(string);
format(string, sizeof(string), "I like %s a lot also I like the number %d.", THIS, rand);
print(string);
}
In my opinion, definitions are better, for that type of code.
I think they don't use memory, while static cost use same size memory as normal variables. I only saw constants in parameters of a function as there we can't use definitions there. Question: why are you defining costants as static? they can't be changed so... |
Question: why are you defining costants as static? they can't be changed so...
|
Say that again please, and now with thinking before you say it.
Definitions don't use memory? Oh really? Explain me why you think that something doesn't use/require resources, I'll be glad to hear. |
#define NUMBER_ONE 1
#define abs(%0) (%0<0)?(-%0):%0 // I think this code is okay.