Output string to console - C String

C examples for String:Display

Introduction

To output the string stored in message using the printf() function, you could write this:

Demo Code

#include <stdio.h>

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

  printf("\nThe message is: %s", message);

  return 0;//from  w  w w  .j  a  v  a 2  s  .  c o m
}

Result


Related Tutorials