现在的位置: 首页 > 综合 > 正文

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

2012年08月29日 ⁄ 综合 ⁄ 共 453字 ⁄ 字号 评论关闭

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.

抱歉!评论已关闭.