fork(2) download
  1. #include <stdio.h>
  2. int *pnum;
  3. void teste() {
  4. printf("%d\n", *pnum);
  5. }
  6. void teste2() {
  7. int num = 20;
  8. pnum = &num;
  9. }
  10. void teste3() {
  11. int num = 30;
  12. num++;
  13. }
  14. int main() {
  15. int num = 10;
  16. pnum = &num;
  17. teste();
  18. teste2();
  19. teste3();
  20. teste();
  21. return 0;
  22. }
Success #stdin #stdout 0s 2112KB
stdin
Standard input is empty
stdout
10
31