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

Method setName

week09/examples/static.cpp:40–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38 }
39
40 void setName(const char * s)
41 {
42 if (s == NULL)
43 {
44 std::cerr << "The input is NULL." << std::endl;
45 return;
46 }
47 size_t len = 1024 - 1;
48 strncpy(name, s, len);
49 name[len] = '\0';
50 }
51 void setBorn(int b)
52 {
53 if (b >= 1990 && b <= 2020 )

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected