Dostum olayı çözdüm baya araştırdım en doğru çalışan şurada yazdıklarım bir dener misin?
#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(" %30[^\n]", (humans+i) -> fullname);
printf("Please enter the %s's jobs: ",(humans+i) -> fullname);
scanf(" %30[^\n]", (humans+i) -> job);
}
return 0;
}
Hocam gerçekten çok çok teşekkür ederim çalıştı 🙏🙏🙏