First Impressions

Geoff Carlton gcarlton at iinet.net.au
Sun Oct 1 15:58:32 PDT 2006


Bruno Medeiros wrote:
> Precisely! And even if such conceptual difference didn't exist, or is 
> very rare, 'string' is nonetheless more readable than 'char[]', a fact I 
> am constantly reminded of when I see 'int main(char[][] args)' instead 
> of 'int main(string[] args)', which translates much more quickly into 
> the  brain as 'array of strings' than its current counterpart.
> 

There are also many cases where char arrays are not strings:

Single array of characters, not strings:
  char GAME_10PT_LETTERS[] = { 'x', 'z' };

Two-dimensional array of characters, not string arrays:
  char GAME_LETTERS[][] = { GAME_0PT_LETTERS, GAME_1PT_LETTERS, .. };
  char m_scrabbleBoard[20][20];



More information about the Digitalmars-d mailing list