This repository has been archived on 2023-10-26. You can view files and clone it, but cannot push or open issues or pull requests.
VSMechatronics/Exercises/C11/initialise_string_example_1.c

16 lines
353 B
C
Raw Permalink Normal View History

2022-04-08 15:12:38 +00:00
#include <stdio.h>
#include <stdlib.h>
// Main : Execution starts here...
int main(void)
{
// Declare variable - pre-populate the array
char msg[] = {'H','i',' ','W','o','r','l','d','\0'};
// Output with printf
printf ("The text is: %s\n", msg);
puts(msg); // We could also use puts to display the string
return 0; // Exit the application
}