Added book examples
This commit is contained in:
19
C7/string_with_gets.c
Normal file
19
C7/string_with_gets.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
int main()
|
||||
{
|
||||
// Declare variable - maximum 99 characters
|
||||
char str[100];
|
||||
|
||||
// Prompt for text
|
||||
printf("enter some text\n");
|
||||
|
||||
// Store intput in str
|
||||
gets(str);
|
||||
|
||||
// Display a message on the screen
|
||||
printf("you entered : %s\n", str);
|
||||
|
||||
// Exit from main
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user