面向对象程序设计ch06
- 格式:ppt
- 大小:1.14 MB
- 文档页数:19


二级C语言笔试-48(总分90, 做题时间90分钟)一、选择题在下列各题的A) 、B) 、C) 、D) 四个选项中,只有一个选项是正确的。
1.以下函数调用语句中实参的个数是( )func((exp1,exp2),(exp3,exp4,exp5));SSS_SINGLE_SELA 1B 2C 4D 5分值: 1答案:B2.有以下程序#includ2<stdio.h>#include<string.h>main()char b1[8]="abcdefg",b2[8],*pb=b1+3,while(--pb>b1)strcpy(b2,pB) ;printf("%d\n",strlen(b2));程序运行后的输出结果是( )SSS_SINGLE_SELA 8B 3C 1D 6分值: 1答案:D3.有以下结构体说明和变量的定义,且如下图所示指针p指向变量a,指针q指向变量b。
则不能把结点 b连接到结点a之后的语句是( ) struct nodechar data;struct noe *next;a,b,*p=&a,*q=&b;SSS_SIMPLE_SINA B C D分值: 1答案:B4.若有说明:int * p,m=51; n;,以下正确的程序段是( )SSS_SINGLE_SELAp=&m;scanf("%d",&p)Bp=&n;scanf("%d",&P)Cscanf("%d",&p)p=&n;Dp=&n;p=&m;分值: 1答案:D5.若指针p已正确定义,要使p指向两个连续的整型动态存储单元,则正确语句是( )SSS_SINGLE_SELA p=2 *(int *)malloc(sizeof(int));B p=(int*)calloc(2*sizeof(int));C p=(int*)malloc(2* sizeof(int));D p=2 *(int*)calloc(sizeof(int));分值: 1答案:C6.下列定义正确的是( )SSS_SINGLE_SELA static int a[]=1,2,3,4,5B int b[]=2,5C int a(10)D int 4e[4]分值: 1答案:A7.在软件工程中,白箱测试法可用于测试程序的内部结构。
基于HLA 的仿真程序设计研究查 荣1,周希辰2,唐霜天2,钱 眺1 (1.南京信息工程大学电子与信息工程学院,江苏南京210044;2.南京船舶雷达研究所,江苏南京210003)摘 要:在分布式交互仿真中,高层体系结构HLA 以其灵活性、开放性和突出的互操作和重用性成为当今的分布式交互仿真的标准I EEE1516。
研究基于HLA 的程序设计方法对于开发分布式交互仿真系统具有重要意义。
本文从HLA 的对象模型模板(O MT)和接口规范实现的运行支撑环境(RTI )所提供的6种服务入手,结合相应设计实例,给出了设计的步骤和一般方法。
关键词:高层体系结构(HLA );分布式仿真中图分类号:TP311.52 文献标识码:A 文章编号:1009-0401(2008)03-0060-05A study on the si m ulati on p r ogra m design bas ed on HLAZHA Rong 1,ZHOU Xi 2chen 2,T A N G Shua ng 2tia n 2,Q I AN T ia o1(1.E lectron ic &Infor m a tion Institu te of N an jing U niv ersity of Inf o r m a tion Science &Techno logy,N an jing 210044,China;2.N an jing M a rine Rada r Institu te ,N a n jing 210003,Ch ina)A bstra ct:B ecause of its outstanding advantage s of being flexible,open,inter operable and reusable,the high level ar chitecture (H LA )has been becom ing the I EEE1516,the str uc tur e standard of distrib 2uted interacti on si m ula ti on system .The study on the HLA 2based si m ulation pr ogra mm ing is of i mpor 2tance t o the developm ent of distributed interacti on si m ulati on system s .This paper beginswith the HLA ’s object model te mp late and the six se r vice s p r ovided by the run ti me infr a structure .Some exa m ples are pr ovided to give the steps and common m ethod of HLA si m ula ti on pr ogr a mm ing .Keywor ds:High Level A r chitecture (HLA );distributed si m ulation1 引 言分布式交互仿真技术从产生(S I M N ET 计划)到D I S 2.X 、ALSP 协议和I EEE1278.X 系列协议的制定,都没有解决建模与仿真(M &S )领域存在的问题:绝大多数仿真器的应用实现较为独立,不利用它们的互操作和重用性。