问题 单项选择题

以下选项中,正确运用指针变量的程序段是( )。

A.int*i=NULL;

B.float*f=NULL;
scanf("%d",i); *f=10.5;

C.char t='m',*C=&t;

D.long*L;
*C=&t; L='0';

答案

参考答案:D

解析: 选项A定义了一个整型变量i,并且初始化让它指向NULL,接着通过scarnf()函数,改变i指向的存储空间的值,选项A中首先定义了整型指针变量i并初始化为NULL,即表示指针i不指向任何存储单元,即此时还没有为i在内存中开辟存储单元,而在scanf()函数中第二个参数是地址参数,显然在这里i不表示地址,所以下面的scanf("%d",i)语句是不正确的,故选项A不正确。选项B定义了一个实型指针变量f并初始化使它指向NULL,即还没有为f在内存中开辟存储单元,不能向*f代表的存储单元(不存在)中写数据,故选项B错误;选项C中首先定义了一个字符变量t并给它赋初值'm',然后定义一个字符型指针c并让它指向了变量t,这一部分正确,然后接着用了一个语句“*c=&t;”应该将该语句中c前的*去掉,故选项C运用指针变量不正确。选项D中的'\0'是一个转移字符,称作“空值”,可以给指针变量L赋值。所以,4个选项中选项D符合题意。

完形填空

第二节(共5小题;每小题2分,满分10分)

根据短文内容,从短文后的选项中选出能填入空白处的最佳选项。选项中有两项为多余选项。

Shoppers who carefully plan their visit to the grocery store can save money on their grocery bills.   71 

Shoppers should visit the grocery store on a full stomach by scheduling their trip immediately after a large meal. If that’s not possible, they should find something healthy to eat while preparing a grocery list.   72  

Although having a list and sticking to it is the most important factor in saving money, shoppers must prepare lists wisely in order to save.   73  Many special buys are announced through the local newspapers, so buying the “grocery issue” is worth the investment(投资). However, it’s important to remember that many newer, more expensive products first offered through coupons may not yield enough savings for shoppers to give up the product they usually buy.

74  Once at the store, the shopper who wants to save money should follow a few more rules. The shopper should not stay longer than necessary, because bills go up each minute the shopper is in the store. So, setting a time limit and a cost limit can hold down the bill.   75   If the grocery list is a short one, some shoppers choose to use the small hand-held basket instead of the roomy grocery cart.

A.A carefully planned list should include in – season produce and any items on sale or discounted through coupons (优惠券).

B.Of course, the shopper should stick strictly to the shopping list and resist the temptation to buy additional items.

C.People who are full are less tired and more likely to buy what they want.

D.Now that the shopper has completed the grocery list, it’s time to leave for the store. E.You should keep your shopping list carefully in case you can exchange it for coupons.

F.Most shoppers are less persuaded to buy extra goods when they are not hungry.

G.Shopping when not hungry, sticking to a grocery list, and following a few simple rules will cut down the grocery bill.

多项选择题