hi,

I am a cat of little brain, and while I sorta am starting to grok what
is going on with getting Felix to talk to C++, I'm still a little
clueless and scared (it has been a while since I've done C++ which
doesn't help). Might anybody happen to have a few simple examples I
could look at, besides what is in the docs (or perhaps there are
examples in the docs I've overlooked)? In particular, as an example,
how would one interface with Foo below, to be able to "new" up
instances, especially heap-based ones not just stack ones, and call
the getId() routine? Many thanks for any pointers.

<!--Foo.h-->
class Foo
{
 public:
  Foo(int id);
  ~Foo();
  int getId();

 private:
  int _id;
};

<!--Foo.cpp-->
#include <stdio.h>
#include <stdlib.h>
#include "Foo.h"

int main()
{
  Foo *foo = new Foo(42);
  printf( "%d\n", foo->getId() );
}

Foo::Foo(int id) :
  _id(id)
{ }

Foo::~Foo()
{ }

int Foo::getId()
{
  return(_id);
}

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to