Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n;
- scanf("%d", &n);
- char *a[n];
- a[n] = malloc(n*sizeof(char));
- int i;
- int j;
- for (i = 0; i < n; i++) {
- a[i] = malloc(sizeof(char));
- }
- for ( i = 0; i < n; i++) {
- printf("write the words: ");
- scanf("%s", a[i]);
- }
- //till this point everything works
- //now I need to print each character of the strings
- for ( i = 0; i < n; i++) {
- for ( j = 0; j < strlen(a[i][j]); j++) {
- printf("%s", a[i][j]);
- }
- }
Add Comment
Please, Sign In to add comment