用户在float变量中存储字符串时如何抛出异常?

时间:2015-06-11 06:12:20

标签: c++ exception-handling

var price1 = document.getElementById("result1");

但isdigit也会为数值抛出异常。

如何解决?

1 个答案:

答案 0 :(得分:5)

aircraft

是一种方法。如果输入以数字开头,则程序将采用PFObject.saveAllInBackground([customValue1, customValue2]) { result, error in // Now all three are saved together, even though aircraft wasn't explicitly saved. } 路径,否则为float input; if (cin>>input) { //all is good ... } else { throw "error"; } 路径。