我目前正在进行代码审查,以下代码让我跳了起来.我看到这个代码存在多个问题.你是否同意我的观点?如果是这样,我如何向我的同事解释这是错误的(顽固型......)?
码:
try
{
// Call to a WebService
}
catch (Exception ex)
{
if (ex is SoapException || ex is HttpException || ex is WebException)
{
// Log Error and eat it.
}
else
{
throw;
}
}
Run Code Online (Sandbox Code Playgroud) 如何创建一个从 1 -> 生成十个随机数的程序RAND_MAX?
RAND_MAX必须是用户输入的数字。
#include <iostream>
#include <stdlib.h>
int main()
{
using namespace std;
int x;
int y;
Random:
{
x = rand();
cout << x << endl;
}
y = y + 1;
if (y == 10) {
return 0;
}
goto Random;
}
Run Code Online (Sandbox Code Playgroud)