Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. int increment(int);
  2. int value = 0;
  3.  
  4. int main() {
  5. cout << increment(value) << endl;
  6. return 0;
  7. }
  8.  
  9. int increment(int value) {
  10. value += 1;
  11. return value;
  12. }
  13.  
  14. int increment() {
  15. value += 1;
  16. return value;
  17. }
  18.  
  19. // Javascript : access and reassignment are viable
  20. var total = 0
  21.  
  22. function call(){
  23. total++ ;
  24. return total ;
  25. }
  26.  
  27. console.log(call()) // 1
  28.  
  29. # Python : only access is viable
  30.  
  31. value = 0
  32.  
  33. def inc():
  34. return "The value is {}".format(value)
  35.  
  36. print(inc()) # The value is 0
  37.  
  38. void increment(){
  39. num +=1 ;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement