Skip to content

Commit

Permalink
add cpp samples
Browse files Browse the repository at this point in the history
  • Loading branch information
t3tra-dev committed Feb 21, 2025
1 parent cb3d86a commit 239c5b0
Show file tree
Hide file tree
Showing 2 changed files with 1,339 additions and 0 deletions.
25 changes: 25 additions & 0 deletions samples/sample-cpp.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include <iostream>
#include <string>

class Person {
public:
std::string name = "Alice";

int age() const {
return 10;
}

void printName() const {
puts(name.c_str());
}
};

int main() {
Person person1;

std::cout << person1.name << std::endl;
std::cout << person1.age() << std::endl;
person1.printName();

return 0;
}
Loading

0 comments on commit 239c5b0

Please sign in to comment.