Added book examples
This commit is contained in:
15
C11/initialise_string_example_2.c
Normal file
15
C11/initialise_string_example_2.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) // Main : Execution starts here...
|
||||
{
|
||||
// Declare variable - pre-populate the array
|
||||
char msg[] = "Hello World";
|
||||
|
||||
// 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
|
||||
}
|
||||
Reference in New Issue
Block a user