Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define MAX_NAMES 100
- #define MAX_BUFFER_CAP 512
- #include <stdio.h>
- #include <stdlib.h>
- #include <conio.h>
- int main(void)
- {
- char names[MAX_NAMES][MAX_BUFFER_CAP];
- int size, i;
- clrscr();
- printf("How many names do you want to store\n(Should be less than 100)? ");
- scanf("%d", &size);
- fflush(stdin);
- for(i = 0; i < size; i++)
- {
- printf("Enter name %d: ", i+1);
- gets(names[i]);
- }
- printf("The names are\n");
- for(i = 0; i < size; i++)
- {
- printf("%s\n", names[i]);
- }
- free(names);
- getch();
- return 0;
- }
Add Comment
Please, Sign In to add comment