C++语言程序设计自测练习(二)2.doc_第1页
C++语言程序设计自测练习(二)2.doc_第2页
C++语言程序设计自测练习(二)2.doc_第3页
C++语言程序设计自测练习(二)2.doc_第4页
C++语言程序设计自测练习(二)2.doc_第5页
已阅读5页,还剩24页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

C + + language programming checklist (b)A multiple-choiceA function call can not ().A. appear in an expressionB. appear in the statement is executedC. as a function of the argumentD. as a function of the shape parameter2 described in the following correct ().A. definition of the function can be nested function calls can not be nestedB. the definition of the function can not be nested function calls can be nestedC. function definitions and function calls can be nestedThe D. function definitions and function calls are not allowed to be nestedThe array name as an argument of the function call is passed to the parameter ().The first element of the value in the array in the first address of the array B. A.C. number of array elements array of all elements of the value D.4 and the following description of the error is ().A. called function without return statementB. called function can be used in more than one return statementC. the function is called, if the return value, you must have a return statementD. the called function, a return statement can return multiple values to the calling function5 following a correct description of ().A. not allowed to set the default value of the parameterB. set the default value of the parameter can only be set when the function is definedC. Set the default value of the parameter, you should set the parameters to the rightD. Set the default value of the parameter, should all the parameters are setThe purpose of overloaded functions ().A. shared B. reduce spaceC. increase speed D. easy to use, and improve readabilityThe two strings are connected together to form a string, optional () function.A. strlen () B. strcap () C. strcat () D. strcmp ()Correctly () 8.A. Use the # define for constants defined a name, the name of the program and then given another valueB. the name of the constants defined using const type of the points, when the program is run, its value can not be changedC. using inline functions in the program and make the program less readableD. defined functions can be given any position in the formal parameter list of default parameter values9. Following identifier () is a file-level scope.A. function parameter B. statement label C. External static class identifier D. automatic class identifierIncorrect () 10.A. macro replacement does not take up the run time B. macro names typelessC. macro replacement only character to replace D. macro names must be written in capital letters11. C + + language compiler system processing of macro commands ().A. The program runsB. In the procedure when connectingC. and C + + programs other statements compileD. in the other components of the source program before compiling12 when the back of the # include file names with double quotes, looking for the file to be included ().A. Direct search directory system set the standardB. in the source directory where the search first, and then the system set the standard search directoriesC. just search for the source directory whereD. Search all directories on the current logical drive13 after the # include file name in angle brackets enclose when looking for the file to be included ().A. Direct search directory system set the standardB. in the source directory where the search first, and then the system set the standard search directoriesC. just search for the source directory whereD. Search all directories on the current logical driveThe following storage class () the object visibility survival of inconsistent.A. external class B. the automatic class C. internal static class D. register classThe following storage class () of the object is not a local variable.A. external static class B. Class C. function parameter D. register class16 local variables, the following statements are true ().A. Definition of the variable in the program file functions can accessB. Definitions can access any of the following statements in the function of the variables defined atC. define the variables in the compound statement defined at any of the following statements can be accessedD. define the function of the variables defined at any of the above statement can be accessed17 file contains the extension of the file to be included in the command ().A. Must be. H B. can not. H C. h. Cpp D. must be. Cpp18 pretreatment command in the program are based on the () symbol at the beginning.A. * B. # C. & D. 19 set the array as an array, the expression sizeof (array) / sizeof (array 0) results ().A. array array addressThe number of elements in the array B. arrayThe number of bytes occupied by each element in the array of C. arrayD. array array of accounting for the total number of bytes20 new operator to create a correct statement is a one-dimensional array of integers containing 10 elements ().A. int * p = new a 10; B. int * p = new float 10;C. int * p = new int 10; D. int * p = new int 10 = 1,2,3,4,521. Following initial value to a character array ().A. char s1 = abcdef; B. char s2 4 = abcd;C. char s3 2 3 = abc, xyz; D. char s4 4 = a, x, s, t;22. Has defined static int data 5 6;, set the starting address of the array in the static storage area is decimal 100, if each of type int, 4 bytes, the array elements the address of the data 2 3 ().A. 115 B.124 C.130 D.16023. Assume that the variable m is defined as int m = 7;, defines the correct statement of the variable p ().A. int p = &m; B. int * p = &m; C. int & p = * m; D. int * p = m;24 Assuming that k is a variable of type double, the statement about the correct definition of the variables p ().A. double p = &k; B. int * p = &k;C. double & p = * k; D. char * p = Thank you!;25 the variables s the definition of char * s = Hello world! ; Make the variable p points s the point with a string, you should select ().A. char * p = s; B. char * p = &s; C. char * p; p = * s; D. char * p; p = &s;26. Void pointer, the following statements are true ().A. void pointer is not pointing to any data pointerB. void pointer is to define uninitialized pointerC. pointer to point to any type of data can be directly assigned to a void pointerD. void pointer value can be directly assigned to a non-void pointer27 assumes that a definition statement int a 10, x, * pa = a;, make the array a subscript elements assign the value of x is not the correct statement ().A. x = pa 3; B. x = * (a +3); C. x = a 3; D. x = * pa +3;28. Assuming defined int b 10; int * pb;, is not the correct assignment statement ().A. pb = b; B. pb = & b 0; C. * pb = new int; D. pb = b 5;29 assume that p is a pointer variable having a double type expression + + p so that the value of p (in bytes) Increase ().A. 1 B. 4 C. sizeof (double) D. sizeof (p)30. Assume that p points to a string of string, cout p +3 output ().A. string B. ring C. ing D. i31. Assume that p points to string string, To output the address of the string value ().A. cout * p; B. cout p; C. cout &p; D. cout title, Wang Tao); B. strcpy (book.title, Wang Tao);C. strcpy (* book.title, Wang Tao); D. strcpy (* book) - title, Wang Tao);36. Assume that the struct BOOK char title 40; float price; BOOK * book; is not the correct statement ().A. BOOK * x = new book; B. BOOK x = C + + Programming, 27.0;C. BOOK * x = new BOOK; D. BOOK * x = book;37 assumed struct BOOK char title 40; float price; book;, the correct statement ().A. BOOK & x = &book; B. BOOK & x = book;C. BOOK & x = new BOOK; D. BOOK & x = BOOK;38 The following is quoted statement is incorrect ().A. Each reference aliases are the object to which it refers, and therefore must be initializedB. form for reference operation is actually acting on the objects it referencesC. Once you have defined a reference, all operations for the object to which it refers only indirectly by the referenceD. do not need to individually allocate storage space for the reference39. Assumed that variables a and PA defined as a double A 10, * pa = a; To 12.35 A subscript assigned to the elements 5, incorrect statement is ().A. pa 5 = 12.35; B. a 5 = 12.35;C. * (pa +5) = 12.35; D. * (a 0 +5) = 12.35;40 assumes that the variable b and pb defined as the int b 10, * pb = b;, To 24 assigned to b 1 element incorrect statement ().A. * (pb +1) = 24; B. * (b +1) = 24; C. * + + b = 24; D. * + + pb = 24;41. Assumes that the pointer variable p is defined as int * p = new int (100); To free the dynamic memory pointed to by p, the statement should be used ().A. delete p; B. delete * p; C. delete &p; D. delete p;42. Assumes that the pointer variable p is defined as int * p = new int 30; To free the dynamic memory pointed to by p, the statement should be used ().A. delete p; B. delete * p; C. delete &p; D. delete p;43 assumes that the variable x is defined as int x = 5;, to make rx x reference (alias) rx should be defined as ().A. int rx = x; B. int rx = &x; C. int * rx = &x; D. int & rx = x;44 about the message, the following statement is incorrect ().A. Send Message Object Request service message object to provide serviceB. message sender must understand how the recipient of the message corresponding messageC. In C + +, the sending of a message is a concrete manifestation of the invocation of a function of the object receiving the messageD. Each object can only receive a certain message format45 package, the following statement is incorrect ().A. Adoption of the package, the object of all the attributes and operations together to form a wholeB. by encapsulating the implementation details of an object as possible hidden (not visible)C. Adoption of the package, each object to be relatively independent entitiesD. Adoption the package attributes of the object is not visible46 polymorphism of object-oriented methods ().A. A class can be derived special classB. an object can have different variants in the different operating environmentsC. for news, different objects can be a response to suit its own wayD. an object can be caused by a combination of a plurality of other objects47 software products in the demand for change in the operating environment changes or errors or shortcomings of the software product itself, the degree of difficulty of the corresponding software updates called software ().Of A. the maintainability B. reusability C. Compatibility D. correctness48. Software product may be wholly or partially re-used the ability of the new application called software ().Of A. the maintainability B. reusability C. Compatibility D. correctness49 software products and other software products combined into an overall degree of difficulty is called software ().Of A. the maintainability B. reusability C. Compatibility D. correctness50 software products ability to perform the tasks required in the software requirements specifications accurately called the (software).Of A. the maintainability B. reusability C. Compatibility D. correctnessSecond, fill in the blank1. Expressions containing random function rand ()% 20 value of _ to _ interval.2 in the switch statement, each statement label the keyword case behind the expression contained must be integer _.If statement, each else keyword with it in front of the same level and closest to the _ keyword matching.4. As statement label use C + + reserved word case and default can only be used in the the _ statement defined body.Switch statement is executed during expression evaluation as a condition down from a matching label position from execution, to _ execute when the encounter next label position.6 If the head of the while loop is a while (i + + = 10), and the initial value of i is 0, and does not modify the value of i in the loop body, the body of the loop will be executed repeatedly _ times after the end of normal.Do loop tail as while (+ + i 10), and the initial value of i is 0, while in the body of the loop does not modify the value of i, the loop body is executed repeatedly _ _ times after the end of normal.When _ statement in the program execution will end the execution of the loop class statement or switch statement.9. _ Statement in the program execution will end where the loop statement first execution of the loop body.10. _ Statement in the program will end where during the execution of the function to return the position to call the function.11. In the _ function, the program execution will end the process of the implementation of the entire program, and return to the operating system under C + + integrated development window.12 elements of type int array a 10 of bytes of storage space occupied by _.13 element type of a two-dimensional array of double a 4 6 Total bytes of storage space occupied by _.14 elements of the two-dimensional array of type char a 10 30 Total occupied _ bytes of storage space.15 the store character a and the string a takes _ and _ bytes.16 empty string, the length of _, store it takes _ bytes.17 string a xy = n , length _.18 the length of the string a: xxk data _.19 for storing a length n string character array of length at least _.20 If a is an array of characters, from the keyboard to the array input a string expression _.21 If a character array to the screen output a string stored expression _.22 in a two-dimensional array of characters, a 10 20 is capable of storing _ strings, each string of length at most _.23. Initialized data of a two-dimensional array of characters A 123, 456, 789, A 1 elements corresponding string is _._ 24. Strlen (apple) value _ strcmp (a, A) has a value of.25 For want of a string aaa to assign values to the array of characters a, you need to perform the the _ function calls to achieve.26. Assumes two-dimensional array a 3 4 for initializing data for 3,5,6, 2,8, 7, A 1 1 and a 2 3 are initialized to _ and _.27 in the C + + language, a function by function head and _.28 overloaded a function: This function must be different from the other function of the same name in the number of parameters or parameter _.29 If a function is only allowed to function calls in the same file, it should be before the function definition with _C + + reserved words.30 double x = 100; is a global variable defined file F1.CPP in statement, if a function requires file F2.CPP in to access this x should file F2.CPP, add x statement statement for _.31 defining a function template to use a modifier is _.32 in the parameters of the function template the class modified parameter called _ parameters.33. If a function, directly or indirectly, to call itself, such a call is called _ call.34. Known the cubin int cubin (int n) return n * n * n; and double (double n) return n * n * n; are two instances of a function template, it is assumed that the type parameter T the definition of the function template is _.35 For without the return value of the function, defined functions use _ the modified function type.36 If a function is defined using _ modified, the function does not allow other file function call.37 If a function has multiple default parameters, the default parameters must all be in the _ part of the formal parameter list.38. Defined external variables without storage class specifier _, and use it to declare external variables.39. Call system function, first use the # include command contains the system function prototype statement where _.40. Scope of the function parameter is the function of _.41. C + + the pretreatment command provides macro definition commands, conditional compilation command and _.42. Program is compiled based on _ units.43. C + + the program runtime memory space can be divided into global data area, heap area, stack area and _.44 global variables and static local variable has the the static survival, stored in the memory of _ District.45. Partial survival of local variables, stored in the memory of _ District.46 if a two-dimensional array a m columns, set a 0 0 the first position in the array, is calculated to any element of a i j in the array position number formula _ .47 If the definition of double a 3 5;, a array subscript of BOC and column subscripts max were _ and _.48 If the definition of struct AA int a; char b; a double c; x; then x footprint size _ bytes.49 When defining a structure variable, the system assigned to the variable memory size is equal to each member of the memory size required _.50 a pointer to a

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论