Cześć wszystkim,
Mam pytanie co do 34 linijki, wytłumaczyłby mi ktoś jak rozwiązać to ostrzeżenie?
warning: assignment to 'int' from 'struct happy_number *' makes integer from pointer without a cast
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
struct happy_number{
char name[11];
char surname[11];
int numberlet;
}*students;
struct happy_number load(int n, int *max);
int main(){
int n, max=0;
printf("How many students do you want to designate? ");
scanf("%d", &n);
students = (struct happy_number*)calloc(n, sizeof(struct happy_number));
*students = load(n, &max);
return 0;
}
struct happy_number load(int n, int *max){
srand(time(NULL));
for(int i=0; i<n; i++){
fflush(stdin);
printf("Enter a name: "); gets((students+i)->name);
printf("Enter a surname: "); gets((students+i)->surname);
(students+i)->numberlet = rand()%20;
printf("His/Her number: %d", (students+i)->numberlet);
}
*max = students+0;
/*for(int i=0; i<n; i++){
if (*max <( students+i)); *max = students+i;
}*/
return *students;
};