brintos

brintos / llvm-project-archived public Read only

0
0
Text · 349 B · 3785cd3 Raw
21 lines · cpp
1namespace N0 {2namespace N1 {3 4char *buf0 = nullptr;5char buf1[] = {0, 1, 2, 3, 4, 5, 6, 7};6 7char sum(char *buf, int size) {8  char result = 0;9  for (int i = 0; i < size; i++)10    result += buf[i];11  return result;12}13 14} // namespace N115} // namespace N016 17int main() {18  char result = N0::N1::sum(N0::N1::buf1, sizeof(N0::N1::buf1));19  return 0;20}21