Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- #include <string.h>
- int main()
- {
- char movie [20];
- char * pMovie = movie; //no & is needed
- // this array only has space for 20 items
- // if we store more than 20, some data can get overwritten
- // fgets limits the input to a certain amount
- // if the user enters more, then it will only get the first 20
- fgets(pMovie, 20, stdin); //stdin means input from keyboard, not file
- puts(pMovie);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement