A. assignment operator.
B. class object.
C. dot operator.
D. fundamental data type.
The members of a structure can be accessed through the use of dot operator. Syntax: structure-name.member-name
A. one is structure and other is class.
B. elements are of different types.
C. structures are of same type.
D. two structures are defined.
Structure assignment is possible only if both the structures are of same type. Only assignment(=) is possible for two similar structures. Other operations, such as comparisons (== and !=) are not defined for similar structures.
A. structure variable name.
B. structure name.
C. subscript value.
D. structure member name.
Members of structure can be accessed using dot operator. Syntax : structure-name.member name
A. structure.
B. struct.
C. define.
D. tag.
A structure is a class declared with keyword struct, which tells the compiler that a structure is being defined.
A. sub structure.
B. class.
C. nested structure.
D. data type.
A structure defined within another structure is called nested structure. A structure element may be either complex or simple. The simple elements are any of the fundamental data types of C++ i.e., int, char, float, double. A structure may consist of element that itself is complex i.e., it is made up of fundamental types, e.g., arrays, structures etc.
A. same data type.
B. int data type.
C. different data type.
D. char data type.
In structure elements can be of different data type and treated under one unit. For example, the elements storing a student's information (e.g.,rollno, name, class, marks, grade) need to be processed together. So in that situation we can use structure.
A. period (.).
B. comma(,).
C. curly brace{ }.
D. semicolon(;).
The structure variable name is followed by a period(.). Structure member can be accessed through the use of dot operator.
A. passed by value.
B. passed by reference.
C. passed by array.
D. address location is defined.
Passing by reference is the most economical method of dealing with structures and functions. The function will access the actual address locations of where the structures are stored as opposed to working with copies of the structures.
A. single dimensional array.
B. multidimensional arrays.
C. array of strings.
D. a single string.
An array of strings is a two-dimensional character array. the size of first index(rows) determines the number of strings and the size of second index(columns) determines maximum length of each string.
A. variable.
B. constant.
C. address of the last element.
D. address of the first element.
C++ interprets an array name as the address of its first element.
A. not an array.
B. two dimensional array.
C. single dimensional array.
D. multidimensional array.
Single-dimensional arrays are list of same type of elements stored in contiguous memory location in their index order.
A. kanpur.
B. Agra.
C. Poona.
D. Punjab.
Agra, as one space is for null character which acts as a delimiter.
A. variable size.
B. size of the data type.
C. space assigned to null character.
D. maximum number of elements of the array.
The syntax to declare an array is - type name[size]; where size refers to the number of elements that an array contains.
A. compiler.
B. functions.
C. header file.
D. strings.
When the size of an array is not defined then the size of that array can be calculated by a compiler automatically.
A. not be declared along with initialization.
B. be initialized along with declaration.
C. not necessarily be declared.
D. be declared at the end of program.
An array may be initialized at the time of its declaration. Through initialization we can give initial values to the array.
A. 1
B. 0
C. null.
D. undefined in c++.
The index of first element of an array, of size n, is 0 and the index of last element is (n-1).
A. array name is missing.
B. there should be no space between [120] and [150]
C. there should be a +sign before 150
D. float type is not valid here.
The syntax to declare a two-dimensional array is as follows - type Array_name[size_of_row][size_of_column]
A. single dimension.
B. two dimension.
C. more than two dimension.
D. null dimension.
C++ allows to have arrays with more than two dimensions.Manipulation takes more time in these types of arrays.
A. list of information.
B. column of information.
C. matrix of information.
D. type of information.
Single dimensional array is a collection of storage locations for a specific type of data in a series.
A. unsized array.
B. sized array.
C. dualsized array.
D. nullsized array.
In C++ we can skip the size of an unsized array while initialization. It automatically calculates the dimensions of unsized arrays.
A. size
B. sizeof
C. data type
D. amount
sizeof is the operator that calculate the size of a operand. Syntax to use it is given below - sizeof(type) Ex- sizeof(int) returns 2 bytes as an int data type occupies 2 bytes in the memory.
A. a multidimensional integer array.
B. a two dimensional integer array.
C. a single dimensional array.
D. a two dimensional character array.
Arrays of strings are created using a two-dimensional character array. The first index determines the number of strings and second index determines the length of each string.
A. 30 bytes.
B. 60 bytes.
C. 120 bytes.
D. 30 bytes .
The amount of storage required to hold a two-dimensional array is also dependent upon its base type, number of rows and number of columns. The formula to calculate total number of bytes required by a two-dimensional array is given below - total bytes = number of rows x number of columns x sizeof(base type)
A. directly related to its type and size.
B. directly related to its size.
C. directly related to its type.
D. 1 byte only.
An array definition specifies a variable type and size to know how many data items the array will contain.
A. 0
B. 3
C. 2
D. 1
Indexing of elements in an array always starts from 0. So P[0] will point to first element of the array.
A. int variable.
B. one-dimensional array.
C. two-dimensional array.
D. multi-dimensional array.
An one-dimensional array is the simplest form of an array where the number of dimension is only one.
A. integer array.
B. single dimension character array.
C. floating array.
D. two dimensional character arrays.
A string is defined as a character array as C++ does not have a string data type so it implements a string as single-dimension character array.
A.
B.
C. four multidimensional array.
D.
The syntax of declaring a two-dimensional array is type name[i][j]; where i refers to the number of rows and j refers to the number of columns
A. both are of the same data type.
B. both have members of the same data type.
C. tag was omitted while defining the structures.
D. both of them do not contain arrays.
v1 = v2 will work only, when both are of the same data type.
A. with any data type.
B. only with fundamental data types.
C. only with user defined data types.
D. only with float data type.
typedef is used to give an alias name to the existing data types.
A. pass a reference to it.
B. pass its address using a pointer variable.
C. pass it as a structure variable.
D. pass it as an array.
Since, the structure variable belongs to the structure data type. Thus, it has to be passed in the form of a structure.
A. any change made is only temporary.
B. changes are made in the original values of the variable.
C. reference to the entire structure can’t be passed.
D. changes cannot be made when reference to a structure is passed.
In call by reference, the original values get changed.
A. of different data types.
B. of same data types.
C. which are themselves arrays.
D. which are themselves structures.
An array can contain similar elements, the combination having structures within an array is an array of structures.
A. struct.
B. structure.
C. stct.
D. strct.
In C++, a structure is a class declared with keyword struct and by default, all members are public in a structure whereas all members are private by default in a class.
A. d1=d2;
B. D1=d2;
C. date d3={22,8,2005};
D. DATE D={4,3,1999};
D1=d2 is wrong, because both are different data types.
Structure assignment is possible only if both the structures are of same structure type.