首页 > 考试题库
题目内容 (请给出正确答案)
[主观题]

1:(void *)ptr 和 (*(void**))ptr的结果是否相同?其中ptr为同一个指针

1:(void *)ptr 和 (*(void**))ptr的结果是否相同?其中ptr为同一个指针

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“1:(void *)ptr 和 (*(void**))ptr…”相关的问题
第1题
#i nclude void testf(int*p) { *p+=1; } main() { int

#i nclude

void testf(int*p)

{

*p+=1;

}

main()

{

int *n,m[2];

n=m;

m[0]=1;

m[1]=8;

testf(n);

printf("Data v alue is %d ",*n);

}

------------------------------

B)

#i nclude

void testf(int**p)

{

*p+=1;

}

main()

{int *n,m[2];

n=m;

m[0]=1;

m[1]=8;

testf(&n);

printf(Data v alue is %d",*n);

}

下面的结果是程序A还是程序B的?

Data v alue is 8

那么另一段程序的结果是什么?

点击查看答案
第2题
与java程序中获取xml定义控件相关的语句()
A.my_button

B.android:id="@+id/my_button

C.button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { /* Perform. action on click*/ }});

D.Button myButton = (Button) findViewById(R.id.my_button);

点击查看答案
第3题
下面的程序是对Buton的事件处理 btn.setOnClickListener(new OnClickListener() { public v
下面的程序是对Buton的事件处理 btn.setOnClickListener(new OnClickListener() { public v

oid onClick(View v) { Intent it = new Intent(MainActivity.this,SecondActivity.class); startActivity(it); } }); 执行结果是:

A.点击Button后,显示启动MainActivity

B.点击Button后,显示启动SecondActivity

C.点击Button后,创建一个隐式的Intent对象

D.点击Button后,创建一个Activity

点击查看答案
第4题
关键字 volatile 有什么含意 并给出三个不同的例子。一个定义为volatile 的变量是说这变量可能

关键字 volatile 有什么含意 并给出三个不同的例子。

一个定义为volatile 的变量是说这变量可能会被意想不到地改变,这样,编译器就不会去假设这个变量的值了。精确地说就是,优化器在用到这个变量时必须每次都小心地重新读取这个变量的值,而不是使用保存在寄存器里的备份。下

面是volatile 变量的几个例子:

1). 并行设备的硬件寄存器(如:状态寄存器)

2). 一 个 中断 服 务子 程 序中 会 访问 到 的非 自 动变 量 (Non-automatic variables)

3). 多线程应用中被几个任务共享的变量

C 程序员和嵌入式系统程序员的最基本的问题。嵌入式系统程序员经常同硬件、中断、RTOS等等打交道,所用这些都要求volatile 变量。不懂得volatile 内容将会带来灾难。 (嗯,怀疑这否会是这样),我将稍微深究

一下,看一下这家伙是不是直正懂得volatile 完全的重要性。

1). 一个参数既可以是const 还可以是volatile 吗?解释为什么。

2). 一个指针可以是volatile 吗?解释为什么。

3). 下面的函数有什么错误: int square(volatile int *ptr)

{ return *ptr * *ptr;

}

点击查看答案
第5题
#include<iostream.h >void main(){ int a,b,c,d,x;a=c=0;b=1;d=20;if(a) d=d-10;else if(! b
#include<iostream.h >void main(){ int a,b,c,d,x;a=c=0;b=1;d=20;if(a) d=d-10;else if(! b

#include<iostream.h >

void main()

{ int a,b,c,d,x;

a=c=0; b=1;d=20;

if(a) d=d-10;

else if(! b)

if(! c) ;

else x=25;

cout<<”d=”<<d<<endl;

cout<<”x=”<<x<<endl;

}

运行结果:

点击查看答案
第6题
public class Example{public static void main(String[] args){int i = 100;switch(i){case 1
public class Example{public static void main(String[] args){int i = 100;switch(i){case 1

public class Example{

public static void main(String[] args){

int i = 100;

switch(i){

case 100:

System.out.print(i);

case 200:

System.out.print(i);

case 300:

System.out.print(i);

}

}

}

点击查看答案
第7题
int (*ptr) (),则ptr是一维数组的名字。

int (*ptr) (),则ptr是一维数组的名字。

点击查看答案
第8题
给定下列程序段: public void method(){ (1) if (someTestFails()){ (2) } (3) }如果要使该
给定下列程序段: public void method(){ (1) if (someTestFails()){ (2) } (3) }如果要使该

方法抛出一个IOException当且仅当someTestFails()返回值为真时,则下列说法正确的是()。

A、在(1)处添加 IOException e;

B、在(2)处添加 throw e;

C、在(2)处添加throw new IOException();

D、在(3)处添加throw new IOException();

点击查看答案
第9题
回答下面的问题(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 函数会有什么样的结果?

点击查看答案
第10题
简述管理单元指针(AU PTR)的作用。
简述管理单元指针(AU PTR)的作用。

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