- 相關(guān)推薦
展訊筆試真題
展訊筆試真題分享
1.給出字符串pszbuff, 將其全部轉(zhuǎn)化為大寫,a轉(zhuǎn)化為a
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char *convert(const char* dest)
{
int ilen=0;
char *tmp=(char *)dest;
char *str;
//strcpy(str,dest);
while(*dest++) ilen++;
str = (char *)malloc(ilen);
while(*tmp)
{
if ( (*tmp>'a') && (*tmp<'z')) {
*str = *tmp + 'a' - 'a' ;
}else{
*str = *tmp;
}
str++;
tmp++;
}
*str='\0';
return str-ilen;
}
int main(int argc, char* argv[])
{
const char pszbuff[] = "abcd";
char *cc;
cc = convert(pszbuff);
printf("%s",cc);
getchar();
return 0;
}
2. 給出輸出結(jié)果,假設(shè)是cpu32位
int main(int argc, char* argv[])
{
char *str="1234567890";
long *plong= (long *)str;
char *pchar = str;
plong++;
pchar++;
printf("%d %d %s\n",sizeof(long),sizeof(plong),plong);
printf("%d %d %s\n",sizeof(char),sizeof(pchar),pchar);
printf("%d",sizeof(int));
getchar();
return 0;
}
答案:
4 4 567890
1 4 234567890
4
更多相關(guān)的筆試題目,大家敬請關(guān)注筆試欄目!
【展訊筆試真題】相關(guān)文章:
家樂福筆試真題07-01
施耐德筆試真題10-28
遠(yuǎn)洋地產(chǎn)筆試真題08-18
用友JAVA筆試真題08-04
金蝶公司筆試真題06-08
箭牌的經(jīng)典筆試真題09-26
網(wǎng)頁編輯筆試真題09-20
招商證券筆試真題10-01
沃爾瑪?shù)墓P試真題分享07-09
Intel筆試真題技術(shù)筆試題目09-10