Store string into array in c

后端 未结 6 1331
孤城傲影
孤城傲影 2021-02-14 21:28

As i know, i can create an array with item inside such as:

char *test1[3]= {\"arrtest\",\"ao\", \"123\"};

but how can i store my input into arr

6条回答
  •  孤城傲影
    2021-02-14 21:53

    int main()
    {
    
    int n,j;
    cin>>n;
    char a[100][100];
    for(int i=1;i<=n;i++){
        j=1;
        while(a[i][j]!=EOF){
            a[i][j]=getchar();
            j++;
        }
    }
    

提交回复
热议问题