Advertisement
Tenjou

Dopple add members dynamically.

Sep 28th, 2014
634
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. // Visit: https://github.com/InfiniteFoundation/dopple
  2.  
  3. // JavaScript
  4. var x = {
  5.     a: 10.2 * -2,
  6.     b: "FooBar"
  7. };
  8.  
  9. x.c = 10 * 0.3;
  10. x.d = "Hello" + " " + "World";
  11.  
  12. // C
  13. #include "dopple.h"
  14.  
  15. static struct {
  16.     double a;
  17.     char *b;
  18.     double c;
  19.     char *d;
  20. } x;
  21.  
  22. void x$__init()
  23. {
  24.     x.a = -20.4;
  25.     x.b = "\x6\x0\x0\x0""FooBar";
  26.     x.c = NaN;
  27.     x.d = "\x9\x0\x0\x0""undefined";
  28. }
  29.  
  30. int main(int argc, char *argv[])
  31. {
  32.     x$__init();
  33.     x.c = 3;
  34.     x.d = "\xb\x0\x0\x0""Hello World";
  35.  
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement