MCPcopy Create free account
hub / github.com/ShiqiYu/CPP / setName

Method setName

week09/examples/function.cpp:11–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9 bool male;
10 public:
11 void setName(const char * s)
12 {
13 if (s == NULL)
14 {
15 std::cerr << "The input is NULL." << std::endl;
16 return;
17 }
18 size_t len = sizeof(name) - 1;
19 strncpy(name, s, len);
20 name[len] = '\0';
21 }
22 void setBorn(int b)
23 {
24 if (b >= 1990 && b <= 2020 )

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected