Witam!
Mam problem z definicją funkcji setgolf. Mianowicie, kiedy próbuje ustawić, aby funkcja w strukturze golf ustawiała dane nazwisko i handicap na podstawie wywołanych argumentów, kompilator daje komunikat o "incompatible types in assignment of 'const char*' to 'char [40]'".
Mój kod:
a) plik nagłówkowy
const int Len = 40;
struct golf
{
char fullname[Len];
int handicap;
};
void setgolf(golf & g, const char * name, int hc);
void setgolf(golf & g);
void handicap(golf & g, int hc);
void showgolf(const golf & g);
b) definicje funkcji
#include<iostream>
#include "golf.h"
void setgolf(golf & g, const char * name, int hc)
{
g.fullname = name;
g.handicap = hc;
}