首页 > 专业科目
题目内容 (请给出正确答案)
[单选题]

char str[]={"FuJian"};print("%d",trlen(tr));该程序段的运行结果是()。

A.9

B.7

C.6

D.8

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“char str[]={"FuJian"};print("%…”相关的问题
第1题
请问以下代码有什么问题: int main() { char a; char *str=&a; strcpy(str,"hello"); prin

请问以下代码有什么问题:

int main()

{

char a;

char *str=&a;

strcpy(str,"hello");

printf(str);

return 0;

}

点击查看答案
第2题
试题7:void Test(void ){char *str = (char *) malloc(100 );strcpy(str, "hello" );free(st

试题7:

void Test(void )

{

char *str = (char *) malloc(100 );

strcpy(str, "hello" );

free(str );

... //省略的其它语句

}

点击查看答案
第3题
试题6:void GetMemory(char **p, int num ){*p = (char *) malloc(num );}void Test(void ){c

试题6:

void GetMemory(char **p, int num )

{

*p = (char *) malloc(num );

}

void Test(void )

{

char *str = NULL;

GetMemory(&str, 100 );

strcpy(str, "hello" );

printf(str );

点击查看答案
第4题
回答下面的问题(6分) (1).Void GetMemory(char **p, int num) { *p = (char *)mallo

回答下面的问题(6分) (1).Void GetMemory(char **p, int num) { *p = (char *)malloc(num); } void Test(void) { char *str = NULL; GetMemory(&str, 100); strcpy(str, "hello"); printf(str); } 请问运行Test 函数会有什么样的结果?

点击查看答案
第5题
. void Test(void) { char *str = (char *) malloc(100); strcpy(str, “hello”);

. void Test(void) { char *str = (char *) malloc(100); strcpy(str, “hello”); free(str); if(str != NULL) { strcpy(str, “world”); printf(str); } } 请问运行Test 函数会有什么样的结果?

点击查看答案
第6题
下列程序在32位linux或unix中的结果是什么?func(char *str){printf(" %d",sizeof(str));printf("

下列程序在32位linux或unix中的结果是什么?

func(char *str)

{

printf(" %d",sizeof(str));

printf(" %d",strlen(str));

}

main()

{

char a[]="123456789";

printf(" %d",sizeof(a));

printf(" %d",strlen(a));

func(a);

}

点击查看答案
第7题
试题7: void Test(void ){ char *str = (char *) malloc(100 ); strcpy(str, "hello" ); free

试题7:

void Test(void )

{

char *str = (char *) malloc(100 );

strcpy(str, "hello" );

free(str );

... //省略的其它语句

}

点击查看答案
第8题
试题6: void GetMemory(char **p, int num ){ *p = (char *) malloc(num );} void Test(void

试题6:

void GetMemory(char **p, int num )

{

*p = (char *) malloc(num );

}

void Test(void )

{

char *str = NULL;

GetMemory(&str, 100 );

strcpy(str, "hello" );

printf(str );

}

点击查看答案
第9题
试题4: void GetMemory(char *p ){ p = (char *) malloc(100 );} void Test(void ) { char *

试题4:

void GetMemory(char *p )

{

p = (char *) malloc(100 );

}

void Test(void )

{

char *str = NULL;

GetMemory(str );

strcpy(str, "hello world" );

printf(str );

}

点击查看答案
第10题
试题5:char *GetMemory(void ){char p[] = "hello world";return p;}void Test(void ){char *s

试题5:

char *GetMemory(void )

{

char p[] = "hello world";

return p;

}

void Test(void )

{

char *str = NULL;

str = GetMemory();

printf(str );

}

点击查看答案
第11题
分析下面的程序: void GetMemory(char **p,int num) { *p=(char *)malloc(num); } int main()

分析下面的程序:

void GetMemory(char **p,int num)

{

*p=(char *)malloc(num);

}

int main()

{

char *str=NULL;

GetMemory(&str,100);

strcpy(str,"hello");

free(str);

if(str!=NULL)

{

strcpy(str,"world");

}

printf("\n str is %s",str);

getchar();

}

问输出结果是什么?希望大家能说说原因,先谢谢了

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改