Is there a diffrence?
#1

In every script I see the format line like this:
pawn Код:
format(string, sizeof(string), "Hello %s", name);
But I saw this in a script, and it's easier to write it like this:
pawn Код:
format(string, sizeof string, "Hello %s", name);
So is there any diffrence at all?
Reply
#2

I think you should add the (string)

Before type it must be a variable like:

pawn Код:
new string[128]
Reply
#3

There isnt any difference between both. The only thing is what you can do with the ( ), you can count multiple things together. Like 'sizeof ( VarA + VarB )'
I myself always use the non brackets one, since its way easier ^^
Reply
#4

The parentheses are optional when having a single argument, and no maths inside. The compiler reads that differently, but the result is the same. It's simply a readability matter.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)