找考题网-背景图
未分类题

以下程序的输出结果是______。 fun(int**p,int a[2][3]) {**p=a[1][2]; } main() { int a[2][3]=}1,3,5,7,9,11},*p; p=(int*)malloc(sizeof(int)); fun(&p,a) ; printf('%d/n',*p); }
D.11

A.9
B.7
C.1

【参考答案】

D
解析:主函数中指针变量指向两字节的存储空间,这两个字节可以存放 int型数据,函数fun是将实参数组a中的元素a[1][2]的值11赋给指针变量p所指的存储空间,程序输出该空间的值。本题函数fun中形参p是二级指针变量,它指向实参指针变量p。
热门试题

未分类题The day of terror at the Virginia Polytechnic and State University in Blacksburg began at about 7:15 A.m., with the shooting of a woman and a male resident adviser on the fourth floor of a dorm building on campus, Kristen Bensley, a freshman who lived below the floor where the shooting occurred, told TIME, 'There were minors going on about the assailant was fighting with his girlfriend or something of that nature'. Bensley notes that only residents can get into the building, using a specific 'passport', that is, a card that one has to swipe in order to open doors before 10 A.m. If he was an outsider, someone would have had to let him in. Or more likely, he was a resident of the dorm himselF.If so, how did be keep so much ammunition unnoticed?Unlike high schools, most universities can't beef up security with a metal detector or two. So what can be done to protect students? Other questions remain unanswereD.Why was there a two-hour gap between the incident at the dorm and a far more fatal one across campus? At one point, that led to theorizing that more than one gunman was involveD.The gunman who killed at least 30 people at Norris Hall shortly after 9 A.m. was described by some sources as an Asian man.It has been a surreal time for the students. Brandon Stiltner, a senior aerospace engineering student, and Jonathan Hess, a senior mechanical engineer, were watching TV all day but by noon they'd had enough. 'We decided we needed to do something', Stiltner saiD.'We were worthless sitting around'. So they took their six-foot Virginia Tech sign off the wall and logged into Facebook. Within the next few hours 100 people replied to their e-mail request for a vigil.By 8 p.m. hundreds bf students began filing down the steps of the War Memorial Chapel toward the drill fielD.Clusters of two and three students stood together in silencE.Slowly they began to line up to sign the boarD.'I'm still really in disbelief', says Stiltner. The shock of the day's shootings sank in, Hess said, as he carried the sign across campus for the vigil. 'It hit me', Hess said, 'to know that it was in these buildings'. The media crews that swarmed campus were also surreal to Hess and Stiltner. 'We could look out our window and see exactly what's on TV', Stiltner says. He watched his sign crowded with initials and prayers, awaiting the names of the victims, He shuddereD.'I hope I don't have any nasty surprises'.Which of the following is tree according to the first paragraph?A.7:15 A.m. is the time a woman and a mate resident adviser were killed on the fourth floor of a dorm building on campus.B.The cause of shooting is the assailant was fighting with his girlfriend or something of that naturE.C.Open dorm's doors needs swipe a card before 10 A.m.D.The gunman was a resident of the dorm himselF.

A.,
B.m.
C.m.
D.
E.
F.m.
G.
Which
H.7:15
I.m.
J.
B.The
K.
C.Open
L.m.
D.The