您的位置:首页 > 其它

微软笔试试题——11月13日,2005年

2005-11-14 11:11 295 查看
Please examine the following code carefully.List any possible bugs in this code and correct the bugs.
#define mkupper(c) ((c)-'a'+'A')
void StringToUpper(char *pStr)
{
while(pStr)
{
*pStr = mkupper(*pStr);
pStr++;
}
}
int main()
{
char *tmp = "aBcdef";
StringToUpper(tmp);
return 0;
}

void _cdecl _assert(
const char *expr;
const char *filename,
unsigned lineno
)
_assert() will display a message and abort
list test cases you would design if you were asked to test the following function.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: