Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int i,n;
- char (*name)[n]= malloc(sizeof(int[i][n]));
- printf("Enter the number of names (<10): ");
- scanf("%d",&n);
- for(i=0; i<n; i++){
- printf("Enter %d names: ",i+1);
- scanf("%s[^\n]",name[i]);
- }
- for(i=0;i<n;i++){
- printf("\nEntered names are:");
- printf("%s",name[i]);
- }
- free(name);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement