Difference [435] NULL '\ 0' 0 language like C

Reference: C / C ++ language, NULL, '\ 0' and 0 of the difference between

Reference: empty string, '\ 0', and the difference between the characteristics of the array is cleared and NULL 0 Analysis

  • Not in the C language null character this thing '', but empty string ""
  • Actually called null character '\ 0', or the corresponding int 0
  • When declaring a string, all characters will be the default setting to '\ 0' is int value 0
  • Therefore, when determining the actual content of the character, it is determined only '\ 0' or 0 can determine the end of the string
  • Because the char can be freely converted int, so a == '\ 0' and a == 0 is exactly the same

Guess you like

Origin www.cnblogs.com/alex-bn-lee/p/11403544.html