35 lines · cpp
1#include <cstring>2#include <string>3 4struct Five {5 int number;6 const char *name;7};8 9Five returnsFive() {10 Five my_five = {5, "five"};11 return my_five;12}13 14unsigned int fib(unsigned int n) {15 if (n < 2)16 return n;17 else18 return fib(n - 1) + fib(n - 2);19}20 21int add(int a, int b) { return a + b; }22 23bool stringCompare(const char *str) {24 if (strcmp(str, "Hello world") == 0)25 return true;26 else27 return false;28}29 30int main(int argc, char const *argv[]) {31 std::string str = "Hello world";32 Five main_five = returnsFive();33 return strlen(str.c_str()); // break here34}35