String or Char Arrays Length Definition

Will that work?

No. A string is terminated by a NULL ('\0'), not a line feed ('\r').