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

Method setName

week09/examples/constructor.cpp:33–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31 }
32
33 void setName(const char * s)
34 {
35 if (s == NULL)
36 {
37 std::cerr << "The input is NULL." << std::endl;
38 return;
39 }
40 size_t len = sizeof(name) - 1;
41 strncpy(name, s, len);
42 name[len] = '\0';
43 }
44 void setBorn(int b)
45 {
46 if (b >= 1990 && b <= 2020 )

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected