1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/dl/sample/c++sample.C

36 lines
412 B
C
Raw Normal View History

#include <stdio.h>
class Person {
private:
const char *name;
int age;
public:
Person(const char *name, int age);
const char * get_name();
int get_age();
void set_age(int i);
};
Person::Person(const char *name, int age)
: name(name), age(age)
{
/* empty */
}
const char *
Person::get_name()
{
return name;
}
int
Person::get_age(){
return age;
}
void
Person::set_age(int i){
age = i;
}