嵌套结构崩溃

#include <stdio.h>
#include<conio.h>

struct details {
    int voteId;
    char Area[50];
    int UC;
};
struct candidateInfo {
    char name;
    int CNIC;
    char city;
    struct details can_data;
}s[10];

int main() {
    int i;
    printf("Enter information of Area/UC/VoterID\n");

    // storing information
    for (i = 0; i < 2; ++i) {
        printf("\n");
        printf("Enter Vote ID: ");
        scanf("%d", &s[i].can_data.voteId);
        printf("Enter Area: ");
        scanf("%s", &s[i].can_data.Area);
        printf("Enter UC: ");
        scanf("%s", &s[i].can_data.UC);
        printf("\n");
        printf("Enter information of Area/UC/VoterID:\n");
        printf("Enter Name: ");
        scanf("%s", &s[i].name);
        printf("Enter CNIC: ");
        scanf("%d", &s[i].CNIC);
        printf("Enter City: ");
        scanf("%s", &s[i].city);
    }
    printf("Displaying Information:\n\n");

    // displaying information
    for (i = 0; i < 2; ++i) {
        printf("\n");
        printf("VoteID: %d",s[i].can_data.voteId);
        printf("Area: ");
        puts(s[i].can_data.Area);
        printf("UC: %d",s[i].can_data.UC);
        printf("Name: %s",s[i].name);
        printf("CNIC: %d", s[i].CNIC);
        printf("City: %s",s[i].city);
        printf("\n");
    }
    _getch();
}

每当我尝试执行该程序时,我都会尝试在您的电子管等所有可用的教程中进行的所有操作,但是错误并未得到解决。它可以运行,但是在显示信息时崩溃,我想我做的一切正确,仍然崩溃,请详细解释我的错误,谢谢。

评论