I'm fairly new to learning C and my English isn't that good either but I need help in my code.
struct mahasiswa{
char name;
char prodi;
int nim;
}Mhs[maxsize];
void inQueue(){
if(!isFull()){
char name, prodi;
int nim,i;
printf("Input name mahasiswa: ");
scanf("%s",&name);
printf("Input NIM mahasiswa: ");
scanf("%d",&nim);
printf("Input Prodi mahasiswa: ");
scanf("%s",&prodi);
Mhs[Queue.akhir].name = name;
Mhs[Queue.akhir].nim = nim;
Mhs[Queue.akhir].prodi = prodi;
++Queue.akhir;
++size;
menu();
}else {
printf("Data penuh");
menu();
}
}
void tampil(){
if(!isEmpty()){
int i;
for(i=0;i<Queue.akhir;i++){
printf("\nNIM : %d\n",Mhs[i].nim);
printf("\nProdi : %s\n",Mhs[i].prodi);
printf("\nName : %s\n",Mhs[i].name);
}
}else {
printf("\nemptydata k");
}
menu();
}
My int data could show up, but not with the string.