helo i make a coding to input some data and when I already input it, i want see my data list.. but i got an error... can u help me please...
this my coding
int *input(struct mahasiswa mhs[])
{
system("cls");
int data,i;
printf("Masukan Jumlah Data : ");scanf("%d",&data);
// mahasiswa mhs[data];
for (i=0; i<data;i++)
{
printf("Masukkan Data ke %d \n",i+1);
printf("Masukan Nim : ",i);scanf("%d",&mhs[i].nim);
printf("Masukan Nama : ",i);scanf("%s",&mhs[i].nama);
printf("Masukan Kelas : ",i);scanf("%s",&mhs[i].kls);
printf("Masukan Jurusan : ",i);scanf("%s",&mhs[i].jurusan);
printf("\n");
The function is not named *input. The function is named input.
As an aside, this is horrific code that has gotosprinkled unnecessarily, will not compile with a modern C++ compiler, makes use of system, and uses printf and scanf instead of sensible C++ alternatives like cout and cin.