fork download
  1. import std.c.stdio;
  2.  
  3. void f( const int i ) { printf ("const\n"); }
  4. void f( int i ) { printf ("non-const\n"); }
  5.  
  6. int main() {
  7. const int i = 42;
  8. int j = 42;
  9. f(i); // const
  10. f(j); // non-const
  11. f(42); // non-const ?
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 2820KB
stdin
Standard input is empty
stdout
const
non-const
non-const