微软笔试试题——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.
#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.
相关文章推荐
- 2014微软校园招聘笔试试题(英文)
- 微软2014校园招聘笔试试题
- 微软2014校园招聘笔试试题
- 2005年华为招聘--C语言笔试试题
- 2005年华为招聘--C语言笔试试题
- 微软2014校园招聘笔试试题
- 微软2014校园招聘笔试试题
- 微软2014校园招聘笔试试题
- 微软2014校园招聘笔试试题
- 分享几条来自微软(Microsoft)的算法设计笔试试题
- 微软2014校园招聘笔试试题
- 2005年Baidu笔试试题及参考答案
- 微软2014校园招聘笔试试题
- 2005年华为招聘--C语言笔试试题
- 2005年华为招聘--C语言笔试试题
- 2005年华为招聘 C语言笔试试题
- 网上的微软笔试试题和答案
- 微软2014校园招聘笔试试题
- 微软2014校园招聘笔试试题
- 2005年华为招聘--C语言笔试试题