Buyrun hocam birde şu algoritmamı deneyin
#include <stdio.h>
#include <stdlib.h>
struct human {
char fullname[30];
char job[30];
};
int main()
{
int amount,i;
printf("How many names will you enter? \n");
scanf("%d",&amount);
struct human *humans = (struct human*) malloc (amount *sizeof(struct human));
for(i = 0; i < amount; ++i){
printf("Please enter the fullname: ");
scanf("%s", (humans+i) -> fullname);
printf("Please enter the %s's jobs: ",(humans+i) -> fullname);
scanf("%s",(humans+i) -> job);
}
return 0;
}
Cevabınız için teşekkürler hocam, fakat aynı hatayı almaya devam ediyorum. "How many names will you enter?" Değerini girdikten sonra ilk çıkan "Please enter the fullname" "Baran Kanat" Degerini girdiğimde art arda değer doldurmama izin vermeden bir diğer elemana geçiyor. Çıktıyı görsel olarak ekliyorum.