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

Method setName

week09/examples/const.cpp:36–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected