I've searched and tried many other answers to problems like mine, but I still don't get it, I don't know what I'm missing here. This program should simulate an auction, it's a game which the smaller "bid" wins. I've come up with this code, but when I use the strcpy and the char variable type, this segmentation error comes up.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int func02(int venc, int nj, int max, int mod, float med, char *nome);
int lanc;
int main (void)
{
lanc = func02(0, 36, 15, 0, 0, "nome");
printf("%d", lanc);
return EXIT_SUCCESS;
}
int func02(int venc, int nj, int max, int mod, float med, char *nome)
{
int lance;
if (venc == 0) {
strcpy(nome, "ceadf");
lance = 4;
}
else {
if ((med <= mod) && (venc >= mod)) {
lance = mod++;
}
else {
lance = venc++;
}
}
return(lance);
}