Quote:
Originally Posted by Arkarr
Why 'char' instend of String ?
|
The reason is alluded to in the post, but it's worth clarifying. In normal type systems, the concept of a "string" is a data type in and of itself. For example:
PHP Code:
string x = "hello!";
In Pawn, it is:
PHP Code:
String:x[] = "hello1";
Here, "String" is really a
storage modifier affecting how the array is allocated. It's not actually a string - it's just telling the array that it's an array of characters. It looks like a string, but it's a hack. Long-term we want to provide a true
string type. It's important that we begin to eliminate the concept of
String: ahead of time, to eliminate any confusion.
char may be unfamiliar but it's much more true to what's actually going on.
I myself look forward to a point in time when we have API calls like this:
PHP Code:
native string GetClientName(int client);
__________________