01/10/2018, 01:08 
               
            Cho mình hỏi mảng chuổi kí tự trong c
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
int main(void)
{
    int arr[100], n;
    char *str[100];
    scanf("%d", &n);
    for(int i=0;i<n;i++)
    {
        printf("Nhap chuoi thứ %d: ", i);
        str[i] = (char*) malloc(100 *sizeof(char));
        gets(str[i]);
        
        arr[i] = i;
    }
    for(int i=0;i<n;i++)
    {
        printf("%s	", str[arr[i]]);
    }
    return 0;
}            
            Bài liên quan
         
               
            




Lạy! “cho mình hỏi”…
Cảm ơn bạn đã hỏi !
Ad @anhhy94 hỏi gì thế???
Bạn vui tính vl~~~~~~~~~~~~
This topic was automatically closed after 16 hours. New replies are no longer allowed.