fork download
  1. #include <stdio.h>
  2.  
  3. void modifique( int* x)
  4. {
  5.  
  6. //int* j = x;
  7. *x = 7;
  8. //*j = 9;
  9. }
  10.  
  11. int main(void) {
  12.  
  13. const int x = 6;
  14. modifique(&x);
  15. printf("%d",x);
  16. return 0;
  17. }
  18.  
  19.  
Compilation error #stdin compilation error #stdout 0s 10304KB
stdin
t y
compilation info
prog.c: In function ‘main’:
prog.c:14:11: error: passing argument 1 of ‘modifique’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
 modifique(&x);
           ^
prog.c:3:6: note: expected ‘int *’ but argument is of type ‘const int *’
 void modifique( int* x)
      ^~~~~~~~~
cc1: all warnings being treated as errors
stdout
Standard output is empty