fork download
  1. #include "iostream"
  2. using namespace std;
  3.  
  4. template<typename T>
  5. void change(T &a)
  6. {
  7. T &x = a;
  8. x = 10;
  9. }
  10. int main()
  11. {
  12. long a=20;
  13. cout << a << endl;
  14. change<long>(a);
  15. cout << a << endl;
  16.  
  17.  
  18. printf("Hello World");
  19. return 0;
  20. }
Success #stdin #stdout 0s 4536KB
stdin
Standard input is empty
stdout
20
10
Hello World