9511_workbook

solved exercises from algorithms & programming I (9511) prof. Cardozo
Index Commits Files Refs README
guia04/ex07.c (416B)
   1 /*
   2  * What is the difference between NULL and '\0'?
   3  * The difference is that NULL is defined as '\0' casted to void*,
   4  * they both are evaluated to the constant value 0, 
   5  * but they are used in different contexts, in general NULL
   6  * is used to check for pointers, and '\0' for the ends of a string.
   7 */
   8 
   9 #include <stdio.h>
  10 
  11 int main (void)
  12 {
  13     printf("'\\0' = %d", '\0');
  14     printf("'NULL' = %d", NULL);
  15 
  16     return 0;
  17 }