fork download
  1. void AugMatrix::helperFunc(std::string &strnum){
  2. std::string tryagain;
  3. int bad = 0;
  4. int watchout = 0;
  5. int strsize = strnum.size();
  6.  
  7. for (int i = 0; i < strsize; i++){
  8. if (!(((48 <= strnum[i]) && (strnum[i] <= 57)) || (strnum[i] == 46))){
  9. bad = 1;
  10. break;
  11. }
  12. if (strnum[i] == 46){
  13. watchout++;
  14. if (watchout == 2){
  15. break;
  16. }
  17. }
  18. }
  19.  
  20. if ((bad == 1) || (2 == watchout)){
  21. std::cout << "Invalid input; please enter numbers. Try again: ";
  22. std::cin >> tryagain;
  23. helperFunc(tryagain);
  24. strnum = tryagain;
  25. }
  26. return;
  27. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:6: error: 'AugMatrix' has not been declared
 void AugMatrix::helperFunc(std::string &strnum){
      ^
prog.cpp:1:33: error: variable or field 'helperFunc' declared void
 void AugMatrix::helperFunc(std::string &strnum){
                                 ^
prog.cpp:1:28: error: 'string' is not a member of 'std'
 void AugMatrix::helperFunc(std::string &strnum){
                            ^
prog.cpp:1:41: error: 'strnum' was not declared in this scope
 void AugMatrix::helperFunc(std::string &strnum){
                                         ^
stdout
Standard output is empty