第一篇:C++Primer Plus 中文版第六版課后題第九章內(nèi)存模型與名稱空間
1. golf.h const int Len = 40;struct golf {
};void setgolf(golf & g, const char * nane, int hc);int setgolf(golf & g);void handicap(golf & g, int hc);void showgolf(const golf & g);golf.cpp char fullname[Len];int handicap;#include
using namespace std;
void setgolf(golf & g, const char * name, int hc){
}
int setgolf(golf & g){ cout << “Enter Golfers' fullname ”;cin.get(g.fullname, Len);strncpy_s(g.fullname, name, Len);g.handicap = hc;
} if(g.fullname[0] == '