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

Method setName

week09/examples/array.cpp:34–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected