Untitled

mail@pastecode.io avatar
unknown
c_cpp
3 years ago
444 B
1
Indexable
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(){
    char *arr[14];
    char *str;
    int i=0;
    str = (char*)malloc(sizeof(char)*100);
    while (scanf("%s",str)!=EOF){
        *(arr+i) = str;
        i++; //eat", "teaa", "cat", "hat", "tata", "tae
        str = (char*)malloc(sizeof(char)*100);
    }
    printf("%d\n",i);
    for(int j=0;j<2;j++){
        printf("%s ",*(arr+j));
    }

    // }
    
    return 0;
}