定义字符指针char *str="hello",已知sizeof(str)=4,则strlen(str)=______。
定义字符指针char *str="hello",已知sizeof(str)=4,则strlen(str)=______。
相关考题:
执行下列语句后,输出结果为steven的是char*str="steven";eout.write(str, );A.strlen(str)B.sizeof(str)C.strlen(str+1)D.sizeof(str-1)
下列程序在32位linux或unix中的结果是什么?func(char *str){printf("%d",sizeof(str));printf("%d",strlen(str));}main(){char a[]="123456789";printf("%d",sizeof(a));func(a);}
下列程序在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);}
char str[ ]= "Hello";char *p=str;int n=10;sizeof(str)=( )sizeof(p)=( )sizeof(n)=( )void func(char str[100]){ }sizeof(str)=( )
以下为 Windows NT 下的 32位 C++程序,请计算 sizeof的值char str[] = “Hello” ; char *p = str ;int n = 10;请计算 sizeof (str )= sizeof ( p ) = sizeof ( n ) = void Func (char str[100]){请计算 sizeof( str ) = }void *p = malloc( 100 );请计算 sizeof ( p ) =
下面的程序各自独立,请问执行下面的四个TestMemory 函数各有什么样的结果?①void GetMemory(char * p){p = (char * )malloc(100);}void TestMemory (void){char *str = NULL;GetMemory (str);strcpy(str, "hello world");prinff(str);}② char * GetMemory (void){char p[ ] = "hello world";return p;}void TestMemory (void){char * str = NULL;str = GetMemory( );printf(str);}③void GetMemory(char * * p, int num){* p = (char * )malloc(num);}void TestMemory (void){char * str = NULL;GetMemory(str, 100);strcpy( str, "hello" );printf(sir);}④void TestMemory (void){char *str = (char * )malloe(100);strepy (str, "hello" );free ( str );if(str ! = NULL){strepy( str, "world" );printf(str);}}
执行下列语句后,输出结果为steven的是 Char * str="steven"; cout. write(str, );A.strlen(str)B.sizeof(str)C.strlen(str+1)D.sizeof(str-1)
库函数strcpy用以复制字符串。若有以下定义和语句: char str1[ ]="GREETING",str2[8],*str3,*str4="GREETING"; 则对库函数strcpy的不正确调用是 ()A.strcpy(str2,"HELLO2");B.strcpy(str3,"HELLO3");C.strcpy(str4,"HELLO4");D.都不正确
下列初始化字符数组的语句,正确的是()。A.char[] str = {'h', 'e', 'l', 'l', 'o'};B.char[5] str = "hello";C.char[5] str = {"hi"};D.char[100] str = "";