How can I convert the code from the "Version "struct" in the code contains and uses class and objects. Your variant.
Thank you for finding bugs "GOOLF",but anyway many bugs.
In C++, class and struct are the same thing anyway; the only difference is that structs default to public accessibility and classes to private. I assume you are probably meaning C-style structures though, in which case you would just need to re-create all the methods to take a pointer to the the structure and operate on that instead of "this".
Okay I think I see what you're asking. What you need to do is declare your functions in the struct (or class) instead of outside. Then you don't need to pass your struct into the functions because the functions are inside the struct:
I need a simple implementation of both methods structures. One I know as to create. Another is not present.
Prompt, how to me to make implementation?
p.s. How to me to create a method of struct on similarity of function
1 2 3 4 5 6 7 8 9 10 11 12 13
/*int setgolf(golf & g) /// interaktiv version
{
int io,hnp;
cout<<"What is your name and your handicap:\n";
if(cin.get(g.fullname,Len))
io = 1;
else
io = 0;
cin.get();
cin>>hnp;
g.handicap = hnp;
return io;
}*/