Initializing a char array as constant for standard messages - C String

C examples for String:char array

Description

Initializing a char array as constant for standard messages

Demo Code

#include <stdio.h>

int main(void)
{
  const char message[] = "this is a test.";

  printf("\nThe message is: %s", message);
  
  printf("The character \0 is used to terminate a string.");
  return 0;/* w  w  w .j  av  a 2s  . c  o m*/
}

Result


Related Tutorials