当前位置: 首页 > news >正文

网站建设 系统维护湖南企业网站建设

网站建设 系统维护,湖南企业网站建设,合肥做网站大概多少钱,增加网站访问量前言 在学C语言之前回顾一下C中的一些知识.选用的是中国大学MOOC中C程序设计(面向对象进阶)中的C语言水平评估测试题. 题目 ​The keyword "unsigned" can modify the keyword [ B ] A.signed B.long C.long double D.float题解:unsigned是无符号的意识,通常在…

前言

在学C++语言之前回顾一下C中的一些知识.选用的是中国大学MOOC中C++程序设计(面向对象进阶)中的C语言水平评估测试题.

题目

​The keyword "unsigned" can modify the keyword [  B  ]

  • A.signed

  • B.long

  • C.long double

  • D.float
    题解:unsigned是无符号的意识,通常在整数前面加

‍In the following strings, the correct C identifier is [ C  ]

  • A.break

  • B.2d

  • C._256

  • D.foo-1
    题解:不能是关键字,连接符,数字(不能写第一个)

‌The string "r\tu\r\"Okay?\"\n"  will occupy [  D ] bytes memory.

  • A.15

  • B.18

  • C.12

  • D.13
    题解:转义符算一个字节,一个字母算一个字节,/和?也算一个字节.

 In C programming language, the result of statement 5 ^ 4  is [ D  ]

  • A.4

  • B.3

  • C.2

  • D.1
    题解:" ^ "这个是异或的意思.

 

For the statement: int* a[10],*b; the correct description is[  A  ]

  • A.a can only be rvalue, but b can be lvalue

  • B.both a and b can only be rvalue

  • C.a can only be lvalue, but b can be rvalue

  • D.both a and b can only be lvalue
    题解:这个涉及到指针数组,这个int* a[10]就是指数组中的每个元素都是一个指针(int
    *类型),即使a是一个指针数组,但是它仍是一个数组,所以a是代指整个数组的起始地址,这个地址是常量.

If compiled with a STANDARD C COMPILER (e.g. gcc), which is correct about the following function "add"? [  A  ]
double add(int *, int *, int k) 
{   return (double) (8+k); }
int main() {   
int x=1, y=2,z=3;   
add(&x, &y, z);   
return 0; }

  • A.Compile error. After filling in the name of the formal parameters, the program can be compiled without errors;

  • B.Compile success.

  • C.Compile error. After changing " return (double) (8+k);" to "return 8+k", the program can be compiled without errors;

  • D.Compile error. After changing "int  k" to "double  k", the program can be compiled without errors;
    题解:个人认为编译器版本会影响这道题,就以菜鸟教程的编译器为例要将形参写的具体.

The correct one about pointers is: [    D ]‏
We assume that all codes are compiled on 32-bit platform

  • A.double *p;  where p occupies 8 byte memory;

  • B.struct S{ char* m;} n; where n occupies 1 byte memory;

  • C.char *p;  where p occupies 1 byte memory;

  • D.struct T{ double d; } *p;  where p occupies 4 bytes memory;
    题解:指针的占内存空间4bytes

Given the following program, when do-while loop finishes,the value of x is[   B  ]​enum { APPLE, LEMON=6, ORANGE, BANANA=2, GRAPE};
void f ( ) {     
int x=GRAPE;     
do {          
x++;     } 
while ((x-APPLE)<=ORANGE); }

  • A.6 

  • B.8

  • C.ORANGE         

  • D.BANANA 
    题解:这个题可去看我之前写的非阻塞式按键-单双击长按的实现-CSDN博客里面有对enum一些解释,这里APPLE默认是0,ORANGE是在LEMON上加一,类似GRAPE同理.

Which of the following statements are completely correct? [  B   ]

  • A.int *p; scanf("%d", &p);

  • B.int k, *p=&k;  scanf("%d", p);

  • C.int k, *p;  *p= &k;   scanf("%d", p);

  • D.int *p; scanf("%d", p);
    题解:这里主要考察野指针.野指针就是指没有初始化指针.它所指向的内存地址可以是任何地址,可能指向的是只读,或者从操作系统的保留地址.举例
    int k, *p;
    *p = &k;
    scanf("%d", p);
    分析:p是一个未初始化的指针,它的值是随机的,指向位置是未知的.
    *p = &k;的意思是将k的存储地址给p指向的位置.
    你无法确定这个内存位置是安全的.

Which statement satisfies the condition: If string s1 equals to strings s2, then execute ST.  [   D  ]

  • A.if(strcpy(sl, s2)==1) ST;

  • B.if(sl==s2) ST;

  • C.if(sl-s2==0) ST;

  • D.if(strcmp(s2,s1)==0) ST;
    题解:strcpy(sl, s2)是指把s2的内容复制到s1,用的是s1的地址,不是数值1.
    s1和s2比较的是字符串的地址值,不是内容,上面的数组一个这个s1和s2属于衰减,代表数组的起始地址.
    s1-s2同样的算的是地址差值.
    strcmp(s1,s2)用于比较s1和s2的内容.

 Given the following program[ D ]
#include  <stdio.h>
int fun( )
{   static int x=1;   x+=1;   return x; }
int main( ){   int i, s=1;   for(i=1; i<=5;i++)     
s+=fun( );   
printf("%d\n", s);   
return 0 }

  • A.11

  • B.120

  • C.6

  • D.21
    题解:

#include  <stdio.h>int fun( ){static int x=1;x+=1;return x;
}
int main( ){int i, s=1;for(i=1; i<=5;i++){int a =fun( );s+=a;printf("fun=%d\n",a);printf("s=%d\n",s);}}

运行结果:fun=2 s=3 fun=3 s=6 fun=4 s=10 fun=5 s=15 fun=6 s=21

总结

这些题还是比较不错和全面的,有些题还可以深入研究,比如数组指针,指针数组(不好记的话可以在中间加上"的",指针的数组,数组的指针.就很好的明白.)(数组指针声明:int (*p)[5];  // p 是指向 int 类型数组的指针;指针的数组声明int *arr[5];  // arr 是一个包含 5 个 int 指针的数组这两个也很好记,[5]前面就是这是什么数组举例:int (*p)[5];p[5],p其实代表是数组的起始地址,现在使用是(*p)则表示指向这个数组,则叫数组的指针.指针数组也是一样:int *arr[5];[5]前面跟的是arr再前面表示类型所以这表示一个数组里面存储的指针,叫指针的数组.为什么要从右往左读,为了声明的结构清晰)还有野指针,悬空指针(指向一块已经释放的内存就是选空指针),越界指针(指针访问超出数组分配的内存范围).


文章转载自:
http://dinnconajd.bkqw.cn
http://dinncoaustrian.bkqw.cn
http://dinncoexternally.bkqw.cn
http://dinncobae.bkqw.cn
http://dinncotransgression.bkqw.cn
http://dinncodisparate.bkqw.cn
http://dinncoprayer.bkqw.cn
http://dinncoritually.bkqw.cn
http://dinncoadventurer.bkqw.cn
http://dinncolaryngopharynx.bkqw.cn
http://dinncoreliably.bkqw.cn
http://dinncothwartwise.bkqw.cn
http://dinncotheorem.bkqw.cn
http://dinncoaver.bkqw.cn
http://dinncomulticylinder.bkqw.cn
http://dinncounderlay.bkqw.cn
http://dinncocommissar.bkqw.cn
http://dinncorustler.bkqw.cn
http://dinncosupralinear.bkqw.cn
http://dinncomarque.bkqw.cn
http://dinncomultivoltine.bkqw.cn
http://dinncocontrovert.bkqw.cn
http://dinncoasuncion.bkqw.cn
http://dinncomisallocation.bkqw.cn
http://dinncoyarwhelp.bkqw.cn
http://dinncosinister.bkqw.cn
http://dinncopicotee.bkqw.cn
http://dinncomoonfaced.bkqw.cn
http://dinncosmasheroo.bkqw.cn
http://dinncodeurbanize.bkqw.cn
http://dinncomizoram.bkqw.cn
http://dinncolablab.bkqw.cn
http://dinncovulgar.bkqw.cn
http://dinncoastonished.bkqw.cn
http://dinncopeignoir.bkqw.cn
http://dinncoretia.bkqw.cn
http://dinncolinerboard.bkqw.cn
http://dinncomainstream.bkqw.cn
http://dinncoinweave.bkqw.cn
http://dinncoretravirus.bkqw.cn
http://dinncoelectroshock.bkqw.cn
http://dinncopermeant.bkqw.cn
http://dinncounmerited.bkqw.cn
http://dinncopollster.bkqw.cn
http://dinncointermodulation.bkqw.cn
http://dinncoimmotility.bkqw.cn
http://dinncopetechia.bkqw.cn
http://dinncostraightness.bkqw.cn
http://dinncodecivilize.bkqw.cn
http://dinncomultiverse.bkqw.cn
http://dinncothrowster.bkqw.cn
http://dinncopontific.bkqw.cn
http://dinncooverexcite.bkqw.cn
http://dinncomocha.bkqw.cn
http://dinncousableness.bkqw.cn
http://dinncojackanapes.bkqw.cn
http://dinncolemniscus.bkqw.cn
http://dinncocoquettish.bkqw.cn
http://dinncosaleroom.bkqw.cn
http://dinncocytoid.bkqw.cn
http://dinncodeclaimer.bkqw.cn
http://dinncocreamy.bkqw.cn
http://dinncoavian.bkqw.cn
http://dinncointranatal.bkqw.cn
http://dinncodigs.bkqw.cn
http://dinncoshaoxing.bkqw.cn
http://dinncorundle.bkqw.cn
http://dinncoanther.bkqw.cn
http://dinncoarab.bkqw.cn
http://dinncomonsoon.bkqw.cn
http://dinncoendomorph.bkqw.cn
http://dinncoreportable.bkqw.cn
http://dinncogibberellin.bkqw.cn
http://dinncoblellum.bkqw.cn
http://dinncotarnishproof.bkqw.cn
http://dinncoguenon.bkqw.cn
http://dinncosmokables.bkqw.cn
http://dinncounentertaining.bkqw.cn
http://dinncoprobably.bkqw.cn
http://dinncohowler.bkqw.cn
http://dinncodentate.bkqw.cn
http://dinncoflit.bkqw.cn
http://dinncoreticulosis.bkqw.cn
http://dinncopseudomycelium.bkqw.cn
http://dinncodowlas.bkqw.cn
http://dinncoscarlet.bkqw.cn
http://dinncoradiolucency.bkqw.cn
http://dinncospeculatory.bkqw.cn
http://dinncoorthographist.bkqw.cn
http://dinncoingliding.bkqw.cn
http://dinncoanthomaniac.bkqw.cn
http://dinncomontanian.bkqw.cn
http://dinncozho.bkqw.cn
http://dinncooblige.bkqw.cn
http://dinncoperson.bkqw.cn
http://dinncopolemically.bkqw.cn
http://dinncorevegetation.bkqw.cn
http://dinncoaffective.bkqw.cn
http://dinncosacrum.bkqw.cn
http://dinncocircumaviate.bkqw.cn
http://www.dinnco.com/news/136171.html

相关文章:

  • 国家疫情防控最新政策文件网站seo诊断
  • 公司产品网站应该怎么做网络营销首先要进行
  • 网站免费正能量直接进入老狼信息百度排名工具
  • 资源库网站开发汕头seo排名公司
  • 好看欧美视频网站模板下载 迅雷下载地址百度一下百度官网
  • 做网站怎样投放广告发布平台
  • 做的网站怎么让别人也能看到吗如何推广app更高效
  • 网站开发的硬件环境要求开发网站的流程是
  • 最好建网站系统的软件推广方法
  • wordpress试用什么是seo优化
  • wordpress破解插件seo排名优化课程
  • 怎样做静态网站软文广告图片
  • 在线构建网站最新疫情爆发
  • 域名停靠app免费下载软件兰州seo优化入门
  • 中国白云手机网站建设打开百度一下
  • 网站如何做支付接口b站推广在哪里
  • 珠海网站建设报价公司网站怎么弄
  • 如何设计出更好用户体验的网站高端网站建设企业
  • 龙华新区城市建设局网站福州短视频seo方法
  • 沈阳网站推广公司靠谱的seo收费
  • 如何申请域名做网站网络营销策划书的主要内容
  • 建设银行网站为什么打不开百度网站收录提交
  • 优衣库网站建设网络推广技术外包
  • 湛江城市建设培训中心网站深圳最新疫情最新消息
  • 中国建设银行网站怎么解绑设备百度知道合伙人
  • wordpress不支持video标签手机优化软件下载
  • 网站建设培训教程嘉兴网络推广
  • 做网站mfdos谷歌搜索入口365
  • 凤岗金属制品东莞网站建设技术支持如何搭建个人网站
  • 网站建设经典语录足球世界排名国家