fork download
  1. #include <stdlib.h>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int testSwitch(int iSupplyType, string sColumnName)
  7. {
  8. int idx = -1;
  9.  
  10. if (iSupplyType == 0)
  11. {
  12. idx= 0;
  13. }
  14. else if (iSupplyType == 1)
  15. {
  16. idx = 1;
  17. }
  18. else if (iSupplyType == 2)
  19. {
  20. idx = 2;
  21. }
  22. else if (iSupplyType == 3) //test
  23. {
  24. idx = 3;
  25. }
  26.  
  27. return idx;
  28. }
  29.  
  30. main()
  31. {
  32. cout << "testSwitch(3, \"part_id\"): " << testSwitch(3, "part_id") << endl;
  33. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
testSwitch(3, "part_id"): 3