04.07.2020, 22:54
Use notepad++. It shows length of the text. Alternatively, if you have this string: "Your ID is %d!", and your max playerID is 150 and thus 5 characters lang, you could do this:
That way the compiler sets the array size and you don't have to count. However that's inconvenient especially when the inputs can be long. Otherwise, such a thing is not possible afaik (unless when using the dynamic memory plugin)
You keep coming up with string lengths and y_va. va stands for varargs. It's a library that provides va_printf() and va_format(), using a system to easily use multiple undefined parameters. The alternative would be using "..." and functions such as getarg() and numargs(). It doesn't have anything to do with counting the length of a string.
Code:
new string[] = "Your ID is XXX!";
You keep coming up with string lengths and y_va. va stands for varargs. It's a library that provides va_printf() and va_format(), using a system to easily use multiple undefined parameters. The alternative would be using "..." and functions such as getarg() and numargs(). It doesn't have anything to do with counting the length of a string.