PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/chicken/overload/example.cxx

#
C++ | 33 lines | 25 code | 7 blank | 1 comment | 0 complexity | bfc80404dbfd8fb95adfff3ba34c7164 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. /* File : example.c */
  2. #include "example.h"
  3. #include <stdio.h>
  4. void foo(int x) {
  5. printf("x is %d\n", x);
  6. }
  7. void foo(char *x) {
  8. printf("x is '%s'\n", x);
  9. }
  10. Foo::Foo () {
  11. myvar = 55;
  12. printf ("Foo constructor called\n");
  13. }
  14. Foo::Foo (const Foo &) {
  15. myvar = 66;
  16. printf ("Foo copy constructor called\n");
  17. }
  18. void Foo::bar (int x) {
  19. printf ("Foo::bar(x) method ... \n");
  20. printf("x is %d\n", x);
  21. }
  22. void Foo::bar (char *s, int y) {
  23. printf ("Foo::bar(s,y) method ... \n");
  24. printf ("s is '%s'\n", s);
  25. printf ("y is %d\n", y);
  26. }