/trunk/Examples/pike/simple/runme.pike

# · Unknown · 20 lines · 16 code · 4 blank · 0 comment · 0 complexity · f7c853bb7d4f8e551cfe517ff7daddc4 MD5 · raw file

  1. int main()
  2. {
  3. /* Call our gcd() function */
  4. int x = 42;
  5. int y = 105;
  6. int g = .example.gcd(x, y);
  7. write("The gcd of %d and %d is %d\n", x, y, g);
  8. /* Manipulate the Foo global variable */
  9. /* Output its current value */
  10. write("Foo = %f\n", .example->Foo_get());
  11. /* Change its value */
  12. .example->Foo_set(3.1415926);
  13. /* See if the change took effect */
  14. write("Foo = %f\n", .example->Foo_get());
  15. return 0;
  16. }