fork download
  1. #include <stdio.h>
  2.  
  3. #define MONE -1.0
  4.  
  5. int main(int argc, char** argv)
  6. {
  7. double a,b;
  8.  
  9. /* Normal. */
  10. a = MONE;
  11. printf("a => %f\n", a);
  12.  
  13. /* I would expect this to decrement b as well. */
  14. b = 3.0;
  15. a = b-MONE; /* I think this *should* become --> "a = b--1.0;" which should be an error. */
  16. printf("a => %f\n", a);
  17. printf("b => %f\n", b);
  18.  
  19. /* Sanity check. */
  20. b = 3.0;
  21. b--1.0; /* Compiler does not like this. */
  22. printf("b => %f\n", b);
  23.  
  24. return 0;
  25. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:21:8: error: expected ‘;’ before numeric constant
stdout
Standard output is empty