#include <stdio.h>
struct Bar{
int max;
int N;
int k[4];
float g[4];
};
typedef struct Bar myStruct;
myStruct entr(){
myStruct result;
int i;
printf("max\n");
scanf("%d", &result.max);
printf("N = \n");
scanf("%d", &result.N);
printf("\nEnter k = ");
for(i=1; i<=4; i++) scanf("%d", &result.k[i]);
printf("\ng = ");
for(i=1; i<=4; i++) scanf("%f" , &result.g[i]);
return result;
}
void main() {
myStruct entrs=entr();
}
I ran this code in linux (compile with gcc), and every time it has the following error
"* stack smashing detected *: ./a.out terminated Aborted "
How can I resolve this error?**