What is the use of file pointers?
What is the use of file pointers?
File pointers are bassically use for moving the files and docs.Its used to move in the file while writing or reading.
More interview questions and answers |
---|
Question : what is the difference between parameter and argument? |
Diff b/w parameter and argument is : Argument bassically is one of the following - > An Expression in the comma-separated list in a function call. > A sequence of one or more preprocessor tokens in the comma-separated list in a macro call. > Its represent the value which you pass to a procedure parameter when you call the procedure. The calling code supplies the arguments when it calls the procedure. > It is something passed into a function(value), whereas a parameter is the type of data plus the name. Parameter bassically is one of the following - > An object that is declared in a function declaration or definition. > An identifier b/w the parentheses immediately following the macro name in a macro definition. > It is represent a value that the procedure expects you to pass when you call it. The procedure's declaration defines its parameters. This example explains the difference b/w a parameter and an argument: void function(int x, char * rs); //x and rs are parameters template |
Diff b/w Class and Structure is : Class is difined as- >Class is a successor of Structure. By default all the members inside the class are private. >Class is the advanced and the secured form of structure. >Classes are refernce typed. >Class can be inherited. >In Class we can initilase the variable during the declaration. >Class can not be declared without a tag at the first time. >Class support polymorphism. Structure difine as : > In C++ extended the structure to contain functions also. All declarations inside a structure are by default public. > Structures contains only data while class bind both data and member functions. > Structure dosen't support the polymorphism, inheritance and initilization. > Structure is a collection of the different data type. > Structure is ovrloaded. > Structures are value type. > Structure can be declared without a tag at the first time |
Class and Objects are diff but related concepts. Every objects belogs to the class and evry class have a one or more related objets. Class are: > A Class is static. > A class combination of data(called data members)and functions(called member functions). > Class is a userdefined datatype with data members and member functions. > Classe defines object. > One class can define any no of Object. > Class is a template(type) or blue print its state how objects should be and behave. Object are: > Object is an instance of a class while a class can have many objects. > Object is a dynamic. > Objects are the basic runtime entities in an object oriented sysyem. > Data and function which combine into a single entity is called object. > Objects are instances of classes which identifies the class propeties. > Object can't define classes. > Object can created and destroyed as your necessity. > Object is defined as a s/w construct which binds data and logic or methods(functions) both. |
Diff b/w realloc() and free(): realloc(): > It is used to free the memory in the program. > This function is used to resize memory. > realloc() means it giving string variables into the existed memory free(): > Basically It is a macro. Macro used to deallocate memory. > free() function is used free the memory which is allocated by malloc(),calloc() functions. > free() means it empties the array. |
Templates is defined as : > It is a framework for web pages and sites. > Its type of model or standard for making comparisons. > It is a feature of the C++ programming language its allow functions and classes to be operate with generic types. > It is a tool for enforcing a standard layout and look and feel across multiple pages or within content regions. > Its a model or pattern used for making multiple copies of a single object. |
virtual constructors/destructors : Virtual destructors It is a Bassically same as vertual fuction, Its commonly used with inheritance. Since an abstract class must contain a pure virtual method that has to be overridden, a lot of developers commonly declare their destructors pure virtual, since a destructor is sure to be implemented in every subclass. Constructors cannot be virtual. Declaring a constructor as a virtual function is a syntax error. There is no virtual constructor coz virtual thing is in run time n constructor is compile time thing. |
What is the difference between operator new and the new operator? |
Many diff are there : Operator new is bassically just like malloc and new is the conventinally new in C++. The "New" operator allocates a new instance of an object from the heap, Its utilising the most appropriate constructor for the arguments passed. This is Like many operators in C++, The "New" operator for a particular class can be overriden, Although there is rarely a need to do so. "Operator new" is the mechanism for overriding the default heap allocation logic. |
Many diff are there : >Structure in C defines as limited to within the module and cannot be initialized outside but Structure in C++ can initialize the objects anywhere within the boundaries of the project. > C++ have a many methods((Procedures) but in C no methods are there. > By default C structure are Public and C++ structure are private . > C does not support Methods inside structure but C++ does. > In C++ structure we can add functions but in C structure we can't. > In C++, structure behaves like class like can add function, and can use properties on class as inheritance, virtual,etc, But in C, structure we can have only data member but not functions. > Structures in c++ doesnot provide datahiding but a class provides. > classes support polymorphism, But Structures don't. |
What is the difference between "overloading" and "overriding"? |
Many Diffreces are there- Overloading a method (or function) in C++ is the ability for functions of the same name to be defined as long as these methods have different signatures (different set of parameters). Method overriding is the ability of the inherited class rewriting the virtual method of the base class. overridding is runtime polymorphism while overloading is compile time polymorphism. |
Difference between a "assignment operator" and a "copy constructor" |
many diff are there : > Assignment operator assign the object of one object to another aftr the 1st object is fully created but in copy constructor it assign the value of one object to another at the time of its creation . > The copy constructor is use for initialising a new instance from an old instance, And is called when passing variables by value into functions or as return values out of functions. but in Assignment operator is used to change an existing instance to have the same values as the rvalue, which means that the instance has to be destroyed and re-initialized if it has internal dynamic memory. > Copy constructor copies a existing object to a non existing object, which we are going to create. Assignment operation can happen between two existing objects. > The copy constructor is creating a new object. But in The assignment operator has to deal with the existing data in the object. > Copy constructor creates shallow copy but in assignment operator creates deep copy. > The copy constructor is called at initialising the object but the assignment operator is used to assign one object to another. > Copy constructor donot return anything. But in Assignment operator returns object of same type. > The copy constructor initializes uninitialized memory, But in assigenment operator starts with an existing initialized objects. > Copy constuctor initialize the object with the another object of same class But assignment operator can be called on objects of different classes . |
What is the advantage of function overloading according to users point of view? |
We know that function name is same. But each time we are writing code for each function. In this case it is advantageous than normal function. |
Visual C++ is probably the most popular favored compiler, because of it's history of quality and stablity.But in ANSI C++ is a less popular, but is a much more powerful and robust compiler. The IDE is also a lot more powerful than MSVC. |
What is the difference between far pointer and near pointer? |
Many diff are there : > A normal pointer can only point to the main memory location, But the far pointer can have an address of any location of ur memory even seconday one also. > A far pointer is used to access a location which is outside current segment. > Near pointers are fully recognised and evaluated for their entire width. But in Far pointers only allow normal operations to be done to their offset amount and not the segment or paragraph amount. |
virtual functionsdefines as : > C++ virtual function is a member function of a class, whose functionality can be over-ridden in its derived classes. The whole function body can be replaced with a new set of implementation in the derived class. > A virtual function is a member function which we may redefine for other derived classes, And can ensure that the compiler will call the redefined virtual function for an object of the corresponding derived class, Even if we call that function with a pointer or reference to a base class of the object. > A virtual function is a member function of a class, which functionality can be over-ridden in its derived classes. It is one that is declared as virtual in the base class using the virtual keyword. > C++ virtual function properties are: * A member function of a class. * Declared with virtual keyword. * Usually has a different functionality in the derived class. * A function call is resolved at run-time. |
RTTI bassicaly Run Time Type Information. It Certain language features to work a limited amount of information about types is required at runtime. This is the Run Time Type Information or RTTI. |
What happens to the member function in the class when copy constructor is invoked? |
First of all we want to tell you that only the member function have the athourity to invoke any other member function.But cunstructor have a diff property, is that it used to initialise the values to data members. and they are constant and it cannot be invoked any other constuctor. If they are copied compiler should not understand or didnot diffrentiate that what is member function and what is constructor, so ambiquity will be raised. |
What is the difference between block structured language and highly block structured language |
Block Structure Langguage Bassically a normal programming language in which sections of source code contained within pairs of matching delimiters such as "" and "" (e.g. in C) or "begin" and "end" (e.g. Algol) are executed as a single unit. Its A class of high-level languages in which a program is made up of blocks � which may include nested blocks as components, such nesting being repeated to any depth. |
How will you detect if there is memory leak in your C++ program? |
Some time before we have got a some problem of detecting memory leaks in our code, and we didn't afforrd the rates of a brittle software package to do that. It's fairly simple to redefine malloc() and free() to your own functions, to track the file and line number of memory leaks. But what about the new() and delete() operators? It's a little more difficult with C++, if we want to figure out the exact line number of a resource leak. If we are using new and delete operator, We can overload both the operators and can count number off heap allocation and deallocation. You can also get the __FILE__ and __LINE__ to get to know the file name and line number. Now the new and delete of a memory location should be in pair and if its not there is a memroy leak. By using line and file utility you can reach upto the exact location. |
whenever any application get hanged, & we don't know even from wherewe should start debuging....this can be the most difficult . |
In C++ New Operator used to allocate the memory for the object on HEAP. It allocates the memory of size equal to the object of size, The new operator will return NULL or throw an exception on failure. It provides dynamic storage allocation. Its syntax for an allocation expression containing the new operator is: >>-+----+--new--+---------------------+--+-(--type--)-+---------> '-::-' '-(--argument_list--)-' '-new_type---' >--+-------------------------+--------------------------------->< '-(--+---------------+--)-' '-initial_value-' |
Scope Resolution Operator is defined as (::). It used to define the member functions of a class outside the class. It shows the scope resolution operator untangling a mess made by using the same names for different kinds of entities. it resolves global scope to local scope. Ex: int x=20; int main() { x=30; cout<<::x< |
Namespaces bassically provide a simple method for qualifying element and attribute names used in Extensible Markup Language documents by associating them with namespaces identified by URI references. Its allow to group entities like classes, objects and functions under a name. This way the global scope can be divided in "sub-scopes", each one with its own name. It is an abstract container providing context for the items. it holds and allowing disambiguation of items having the same name. |
Difference between a "assignment operator" and a "copy constructor" |
many diff are there : > Copy constructor copies a existing object to a non existing object, which we are going to create. Assignment operator can happen between two existing objects. > copy constructor creates shallow copy assignment operator creates deep copy. > Assignment operator assign the value of one object to another aftr the 1st object is fully created but in copy constructor it assign the value of one object to another at the time of its creation. > Copy constructor donot return anything. Assignment operator returns object of same type. > Copy constuctor initialize the object with the another object of same class whereas assignment operator can be called on objects of different classes . |
What is operator overloading?what r the advantages of operator overloading? |
operator overloading is the property of Object oriented programming which gives an extra ability to an operator to act on a User-defined operand(Objects). Advantages: > It will act differently depending on the operands provided. Its called extesibility. > It is not limited to work only with primitive Data Type. > By using this overloading we can easily acces the objects to perform any operations. > It makes code much more readable. |
What is the compilation difference at the compiler level for C++, VC++ and C# ? |
The C++ compiler has the ability to produce both native and managed instructions.and VC++ is the Microsoft's implementation of C++. Each C++ compiler might compile the code differently but in C# ompiles first into CIL (Common Intermediate Language) and then on runtime. |
Structure name assign a 1 byte from compiler side, spo Size of empty structure in C++ is 1 byte, Classes have no member that's why objects have 0 bytes, However the objects must be legally creatable because the class is not abstract so there must be a way to address the objects. |
structure padding use for avoid the problems , We can use __attribute__(( xxxx )).Structure padding occurs because the structure members must appear at the correect byte boundary, to achieve this the compiler puts in padding bytes so that the structure members appear in the correct location. |
Everything must have a diff address in memory, otherwise there are very confusion with pointers. Hence even an empty class takes up one byte so the next thing we declare will have a different address. |
What are anonymous structure, unions and what are their uses? |
Anonymous unions are standard C++, and they can be found inside an object or inside a namespace. But Anonymous structures are not standard C++, therefore they are implemented as extensions. |
Char *str is just a pointer its can't store anything, If we cout or printf() char *str it prints till it finds termination char ''; char str is a char variable which is capable to store one character and store a string also. Its length can be fixed only at run time.Char* is pointer which store address of char variable . |
class check { public: int a,b; check (); check(const check&); check operator=(const check&); virtual ~check(); }; check::check(const check& y) { cout << "i am in a copy constructor"< |
Disadvantages: > It's not pure object oriented programming language. > Its a Platform dependent > C++ does not give excellant graphics as compare to java. > Its Not case sensitive. > C++ have Less features as comapred to Java& C#. > Its Not applicable in web enviornment. > Does not provide very strong type-checking. > c++ code is easily prone to errors related to data types, their conversions. > Does not provide efficient means for garbage collection. > No built in support for threads. |
Encapsulation bassically defined as : > Encapsulation genral meaning is information hiding. > The purpose of efficiency of memory and speed. > The data and code binds together. > It is an OOP principle of placing the data and functionality within a single entity. > it is to protect data from the client using the classes but still allowing the client to access the data, but not modify it. |
polymorphic class declares or inherits a virtual function. A template class is nothing but a polymorphic class is - because it can work with different data-types, also under one name. |
Public variables - that are visible to all classes. Private variables - that are visible only to the class to which they belong. Protected variables - that are visible only to the class to which they belong, and any subclasses. |
friend class is the bassically which class used when two or more classes are designed to work together.used to share private data between 2 or more classes the function declared as freind are not called using any object it is called like normal . But in virtual class is whihc class aids in multiple inheritance, it is used for run time polymorphism when object is linked to procedure call at run time. |
A pure virtual function is a bassically which function that must be overridden in a derived class and need not be defined. A pure virtual member function is a member function that the base class forces derived classes to provide. Any class containing any pure virtual function cannot be used to create object of its own type. |
What is the diffrence between static_cast and dynamic_cast in RTTI |
Static_cast from a base class pointer to a derived class pointer. It will do this properly for the up cast, And also properly for the downcast, If the object is actually a derived class. If the object wasn't, we'ld get a pointer as if it were, but this might be very bad. > RTTI is not an option and It is an embedded product. Therefore dynamic_cast is not an option. |
it is used to creat a illusion or vertual functianality of pointer,which is used to mutate the objects where single objects have multiple functionality at same time. |
Importance of copy constructor : > Copy constructor is useful when an object is initialized with another existing object or an object is passed by value to a function or an object is returned by value from a function. |
diff are there : >References are aliases to variables , or we can say other name to a given variable, Even pointer holds the address of a particular variable. > A Reference can be thought of as a special type of pointer with certain restrictions. > We can create the array of Pointer but its not in case of reference. > We can use pointer to pointer but we cnt us reference to referece. > We can assign NULL to the pointer but in refencer we can't. > References have to be initialised at the time of declaration and cannot be changed in the code later , whereas this does'nt hold true with the pointer. |
Its a bassicallly a objects which is store pointers to dynamically allocated objects. These pointers are seen as owning the object pointed to, And thus responsible for deletion of the object when it is no longer needed.smart pointer is an abstract data type that simulates a pointer while providing additional features. |
When an operator is overloaded, it takes on an additional meaning relative to a certain class. But it can still retain all of its old meanings. Examples: 1) The operators >> and << may be used for I/O operations because in the header, they are overloaded. 2) In a stack class it is possible to overload the + operator so that it appends the contents of one stack to the contents of another. But the + operator still retains its original meaning relative to other types of data. |
What is the difference between run time binding and compile time binding? |
Dynamic Binding:This is also known as "Late Binding".The address of the functions are determined at runtime rather than at compile time. Static Binding:This is also known as "Early Binding" .The address of the functions are determined at compile time rather than at run time. |
In C passing value to a function is "Call by Value" whereas in C++ its "Call by Reference" 2.C does not have a class/object concept. C++ provides data abstraction, data encapsulation, Inheritance and Polymorphism. 3.C++ supports all C syntax. File extension is .c in C while .cpp in C++.(C++ compiler compiles the files with .c extension but C compiler can not!) 4.In C structures can not have contain functions declarations. In C++ structures are like classes, so declaring functions is legal and allowed. C++ can have inline/virtual functions for the classes. c++ is C with Classes hence C++ while in c the closest u can get to an User defined data type is struct and union. |
The output for the above code would be a garbage value. In the statement a[i] = i++; the value of the variable i would get assigned first to a[i] i.e. a[0] and then the value of i would get incremented by 1. Since a[i] i.e. a[1] has not been initialized, a[i] will have a garbage value. |
:int x = 3000, y = 2000 ; long int z = x * y ; Ans:Here the multiplication is carried out between two ints x and y, and the result that would overflow would be truncated before being assigned to the variable z of type long int. However, to get the correct output, we should use an explicit cast to force long arithmetic as shown below: long int z = ( long int ) x * y ; Note that ( long int )( x * y ) would not give the desired effect. |
Why doesn't the following statement work? char str[ ] = "Hello" ; strcat ( str, '!' ) |
The string function strcat( ) concatenates strings and not a character. The basic difference between a string and a character is that a string is a collection of characters, represented by an array of characters whereas a character is a single character. To make the above statement work writes the statement as shown below: strcat ( str, "!" ) ; |
main( ){ int i[32767] ; float f[16383] ; char s[65535] ; } |
How do I write code that reads data at memory location specified by segment and offset? |
Use peekb( ) function. This function returns byte(s) read from specific segment and offset locations in memory. The following program illustrates use of this function. In this program from VDU memory we have read characters and its attributes of the first row. The information stored in file is then further read and displayed using peek( ) function. #include |
Is it possible to have Virtual Constructor? If yes, how? If not, Why not possible ? |
There is nothing like Virtual Constructor. The Constructor cant be virtual as the constructor is a code which is responsible for creating a instance of a class and it cant be delegated to any other object by virtual keyword means. |
Yes there is a Virtual Destructor. A destructor can be virtual as it is possible as at runtime depending on the type of object baller is balling to , proper destructor will be called. |
The run time type identification comes at a cost of performance penalty. Compiler maintains the class. |
Through Look up tables added by the compile to every class image. This also leads to performance penalty. |
No. Syntax wise It is allowed. But then the function is no longer Inline. As the compiler will never know how deep the recursion is at compilation time. |
By using the extern "C" linkage specification around the C function declarations. Programmers should know about mangled function names and type-safe linkages. Then they should explain how the extern "C" linkage specification statement turns that feature off during compilation so that the linker properly links function calls to C functions. |
It permits a program to reference an identifier in the global scope that has been hidden by another identifier with the same name in the local scope. |
How many ways are there to initialize an int with a constant? |
1. int f = 123; 2. int bar(123); |
What is the difference between a copy constructor and an overloaded assignment operator? |
A copy constructor constructs a new object by using the content of the argument object. An overloaded assignment operator assigns the contents of an existing object to another existing object of the same class. |
There are three acceptable answers:- "Never," "Rarely," and "When the problem domain cannot be accurately modeled any other way." Consider an Asset class, Building class, Vehicle class, and CompanyCar class. All company cars are vehicles. Some company cars are assets because the organizations own them. Others might be leased. Not all assets are vehicles. Money accounts are assets. Real estate holdings are assets. Some real estate holdings are buildings. Not all buildings are assets. Ad infinitum. When you diagram these relationships, it becomes apparent that multiple inheritance is a likely and intuitive way to model this common problem domain. The applicant should understand, however, that multiple inheritance, like a chainsaw, is a useful tool that has its perils, needs respect, and is best avoided except when nothing else will do. |
The simple answer is that a virtual destructor is one that is declared with the virtual attribute. The behavior of a virtual destructor is what is important. If you destroy an object through a baler or reference to a base class, and the base-class destructor is not virtual, the derived-class destructors are not executed, and the destruction might not be compile. |
n a constructor throw a exception? How to handle the error when the constructor fails? |
The constructor never throws a error. |
What are the debugging methods you use when came across a problem? |
Debugging with tools like : GDB, DBG, Forte, Visual Studio. Analyzing the Core dump. Using tusc to trace the last system call before crash. Putting Debug statements in the program source code. |
How the compilers arranges the various sections in the executable image? |
The executable had following sections:- Data Section (uninitialized data variable section, initialized data variable section ) Code Section Remember that all static variables are allocated in the initialized variable section. |
Explain the ISA and HASA class relationships. How would you implement each in a class design? |
A specialized class "is" a specialization of another class and, therefore, has the ISA relationship with the other class. This relationship is best implemented by embedding an object of the Salary class in the Employee class |
When you are designing a generic class to contain or otherwise manage objects of other types, when the format and behavior of those other types are unimportant to their containment or management, and particularly when those other types are unknown (thus, the generality) to the designer of the container or manager class. |
If your class has at least one virtual function, you should make a destructor for this class virtual. This will allow you to delete a dynamic object through a baller to a base class object. If the destructor is non-virtual, then wrong destructor will be invoked during deletion of the dynamic object. |
Malloc/free do not know about constructors and destructors. New and delete create and destroy objects, while malloc and free allocate and deallocate memory. |
Unexpected() is called, which, by default, will eventually trigger abort(). |
C++ allows for dynamic initialization of global variables before main() is invoked. It is possible that initialization of global will invoke some function. If this function crashes the crash will occur before main() is entered. |
If you use auto_ptr objects you would not have to be concerned with heap objects not being deleted even if the exception is thrown. Q33:Is there any problem with the following: char *a=NULL; char& p = *a;? The result is undefined. You should never do this. A reference must always refer to some object. |
Name mangling is the rule according to which C++ changes function's name into function signature before passing that function to a linker. This is how the linker differentiates between different functions with the same name. |
Is there anything you can do in C++ that you cannot do in C? |
No. There is nothing you can do in C++ that you cannot do in C. After all you can write a C++ compiler in C |
It depends on data which programmer want to use, it ups to the implementor to decide what it means to be a fast integer type. |
What�s the best way to declare and define global variables? |
Best Way to represent a variable as global is - Just define the variable at the initial or just below the headers files. though there can be many "declarations" of a single "global" variable or function, there must be exactly one "definition". If a program is in several source files,the best arrangement is to place each definition in some relevant source file, with an external declaration of function n variables in a seperate header file that is included by #include at the front of each source file. |
Extern is bassically significant only with data declarations. In the function declaration case, It can be used as a stylistic hint to indicate that the function's definition is probably in another source file, but there is no formal difference between extern int A(); and int A(); |
We have a three ways for declaring techniques : 1. char *(*(*a[P])())(); 2. Build the declaration up in stages, using typedefs: typedef char *pc; /* pointer to char */ typedef pc fpc(); /* return function pointer to char */ typedef fpc *pfpc; /* pointer to above */ typedef pfpc fpfpc(); /* returning function */ typedef fpfpc *pfpfpc; /* pointer to*/ pfpfpc a[P]; /* array of*/ 3. Use the cdecl program, which turns English into C and vice versa: cdecl> declare a as array of pointer to function returning pointer to function returning pointer to char char *(*(*x[])())() |
void pointer bassicaly used to store address of any type of variable. This is very useful when we want a pointer to point to data of different types at different times. |
'this' pointer is a hidden member of a class or struct.it is bassicaly hidden parameter of non-static member functions. It is a pointer accessible only within the member functions of a class, structure, or union type. |
Mangling is difine as : > A C++ compiler generates function names that include an encoding of the function's argument types. This is known as name mangling. There is no general standard for name mangling. Although all C++ compilers incorporate name mangling, no two do it the same way. We can avoid name mangling by declaring the functions as extern "C"; but we can do this for only one of a set of functions with the same name . |
C++ has three access privileges. They are private, public and protected. public- inherite the protected members as preotected in drived class and pubic members will be public in derived class. protected- pubic and protecated members of the base class will become protected in derived class Private- pubilc and proteacted members will become private in derived class. |
scope resolution operator permits a program to reference an identifier in the global scope that has been hidden by another identifier with the same name in the local scope. |
A modifier as a modifying function is a member function which changes the value of at least one data member. In other words, we can say an operation that modifies the stateof an object. Modifiers are also known as �mutators�. |
it is type of class operation, its does not modyfying the state of an object, these type of fuctions needs to be declare as a constant operation. |
Many diff are there : Template Class bassically a parameterized class not instantiated until the client provides the needed information. It�s jargon for plain templates. But in the Class template specifies how individual classes can be constructed much like the way a class specifies how individual objects can be constructed. It�s jargon for plain classes. |
A container class bassically that class whihc is used to hold objects in memory or external storage. this class acts as a generic holder. It has a predefined behavior and a well-known interface. Its a type supporting class which mainly purpose is to hide the topology used for maintaining the list of objects in memory. When a container class contains a group of mixed objects, that tyme its called heterogeneous container; when the container is holding a group of objects that are all the same, that tyme its called homogeneous container. |
when we use a same name for all the classes |
An iterator class is bassically use for traversing. that are traverse through the objects maintained by a container class. |
Namespaces is a bassically feature of C++. it is a relatively new C++ feature just now starting to appear in C++ compilers. We will be describing some aspects of namespaces in subsequent newsletters. |
Proxy object is a bassically that type of object which Objects that stand for other objects are called proxy objects or surrogates. |
A node class defines as : > it relies on the base class for services and implementation. > It provides a wider interface to the users than its base class. > It relies primarily on virtual functions in its public interface. > It depends on all its direct and indirect base class. > It can be understood only in the context of the base class. > It can be used as base for further derivation. > It can be used to create objects. A node class is a class that has added new services or functionality beyond the services inherited from its base class. |
Stack unwinding is a type of a process. In this process like When an exception is thrown and control passes from a try block to a handler, the C++ run time calls destructors for all automatic objects constructed since the beginning of the try block. This process is called stack unwinding. |
A class invariant is a bassicaly type of condiation .Its defines all valid states of an object. It ensures the proper working of class. |
Messages difines : > Objects communicate by sending messages to each other. > A message is sent to invoke a method. Method desines : > Provides response to a message. > It is an implementation of an operation. |
Dangling pointer occurs when we try to use the address of an object after its lift time is finished. This may occur in situations like returning addresses of the automatic variables from a function or using the address of the memory block after it is freed. |
Incomplete types : > refers to pointers in which there is non availability of the implementation of the referenced location or it points to some location whose value is not available for modification. |
this class is used for traversing. Its traverse through the objects maintained by a container class. Its have a five categories of iterators: > input iterators > output iterators > forward iterators > bidirectional iterators > random access |
Nested classes bassically useful for organizing code and controlling access and dependencies. Nested classes obey access rules just like other parts of a class do.and that class is a class enclosed within the scope of another class. |
What is multiple inheritance(virtual inheritance)? What are its advantages and disadvantages? |
Multiple Inheritance is bassically a process , The process when a child can be derived from more than one parent class. The advantage of multiple inheritance is that it allows a class to inherit the functionality of more than one base class thus Its allowing for modeling of complex relationships. and The disadvantage of multiple inheritance is that it can handle to a lot of confusions like ambiguities and all .... when two base classes implement a method with the same name. |
Whit is the mean of precondition and post-condition to a member function. |
Precondition is defined as a condition that must be true on entry to a member function. If preconditions are never false it means class is used correctly . An operation is not responsible for doing anything sensible if its precondition fails to hold. For example, the interface invariants of stack class say nothing about pushing yet another element on a stack that is already full. We say that isful() is a precondition of the push operation. Post-condition is defines as a condition that must be true on exit from a member function if the precondition was valid on entry to that function. A class is implemented correctly when post-conditions are never false. For example, after pushing an element on the stack, we know that isempty() must necessarily hold. This is a post-condition of the push operation. |
The inline keyword bassically tells the compiler to substitute the code within the function definition for every instance of a function call. Whenever, substitution occurs only at the compiler's discretion. For example, the compiler does not inline a function if its address is taken or if it is too large to inline. |
class wizard bassically use for help in develope a MFC applications, Its help also in customizing the classes. |
The Microsoft Foundation Class Library also called as A Microsoft Foundation Classes or MFC. It is bassically a library that wraps portions of the Windows API in C++ classes,and including functionality that enables them to use a default application framework. Classes are defined for many of the handle-managed Windows objects and also for predefined windows and common controls. MFC library would help us reduce the code and development time. |
Its a normally a base class if two base classes have a no overlapping properties methods they are said to be orthogonal to each other. A class can be derived from these two base classes with no difficulty. |
How can you catch all the exceptions without specifying individually? |
All the exceptions can be caught without specifying them individually by using ellipsis with catch. Syntax is there: catch (�) { ��� ��� } |
Try block is the bassically used to generate exceptions.The try block is a series of statements beginning with the keyword Try, followed by an exception type and an action to be taken. |
Names are there: > Smalltalk > Java > Eiffel > Sather. |
Translation is thebasically interpreting of the meaning of a text and the subsequent production of an equivalent text, That's called a "translation," that communicates the same message in another language. It is a creation of a new program in an alternate language which is logically equivalent the source language program. |
the different forms of throw are there : throw (exception); throw exception; throw; |
Application Wizard provides many things .Its use for ......... > quick access to your applications, documents and pictures. > Open favorite applications and groups of applications. > Quickly open recent applications. > Force applications to open using Rosetta or in Classic. > Open applications automatically at startup. > Quit multiple or all applications at one time. > Quit background-only applications and the Finder. > Force applications to quit or relaunch them. > Switch between applications. > Bring specific windows to the front when making applications active. > Show and hide groups of applications. > Turn on single application mode. > frame work for creating initial applications. |
Error handling is a bassicaly broad category that includes responding to many kinds of errors that are thrown during compilation or at run time. Errors that happen at compile time are often easier to identify.Its code consists of two segments one for detecting and throwing exception and the other for catching the exception. |
Asynchronous exceptions example is Keyboard interrupt. |
Export is bassicaly used to instantiate the non inline template classes and its used also in functions from different files. |
Overflow error bassically a type of arithmatic errors.It's caused by the result of an arithmetic operation being greater than the actual space provided by the system. |
The Word alignment basscially means the tendency of an address pointer value to be a multiple of some power of two. That's why a pointer with two byte alignment has a zero in the least significant bit. And a pointer with four byte alignment has a zero in both the two least significant bits and all . |
Generic Programmng is type of method. The method in which generic types are used as arguments in algorithms for different data types and data structures is called generic programming. |
Parameterized macros are use for the parameters . It is the one which consist of template with insertion points for the addition of parameters. |
Diff are there: Function overloading: C++ defines a same name of the fuctions are in diff set of paprameters.as long as the type is concerned. This capability is called function overloading. When an overloaded function is called, the C++ compiler selects the proper function by examining the number, types and order of the arguments in the call. Function overloading is commonly used to create several functions of the same name that perform similar tasks but on different data types. Operator overloading : Operator Overloading works on objects of user defned classes becouseits alows existing C++ operators to be redefined .Overloaded operators are syntactic sugar for equivalent function calls. They form a pleasant facade that doesn't add anything fundamental to the language. |
What are the functions used to handle single character at a time? |
they have a two functions whihc used to handle single charecter at a time : > put () and > get () |
tellp ()use for the poitner postion : > Its provides the current position of output/put pointer. |
tellg () provides a information about the current position of input/get pointer. |
they are using bassicaly move the I/O in speciafic positions : > Seekp () is used to move output/put pointer to a specified position. > seekg () is used to move input/get pointer to specified position. |
File pointers are bassically use for moving the files and docs.Its used to move in the file while writing or reading. |
Two types of the File Pointers : > Input pointer : The input pointer is used to read the contents in a particular file location. and > Output pointer : The output pointer is used to write the contents in a particular file location. |
It is the bassically means the file to be opened is a binary file. |
diff are there : > Mode is that ios::ate mode allows us to add data or change data anywhere in the file But In ios::app mode allows us to add data only to the end of file. |
class ios. |
Syncronous Eceptions examples are there : > Out of range index > division by zero > overflow etc. |
In C++ storage qualifier bassically a type of : const volatile mutable Const keyword indicates that memory once initialized, should not be altered by a program. volatile keyword indicates that the value in the memory location can be altered even though nothing in the program code modifies the contents. |
EOF bassically stands for End of File, It is used to check for the end of file when a file is being read. |
Manipulators bassically a type of functions. That are included in the I/O statements to alter the parameters of a stream are called manipulators. |
A file is bassically a collection of related data. Which is store on a disk. |
Exception handling is bassically used to detect exceptions becouse it can be taken a corresponding action. |
Using is bassically a namespace scope. Its directive used to declare the accessibility of identifiers declared within a namespace scope. |
Template classes and functions are usually use for eliminate redundancy or ambiguity of code and help in easier program or user friendly programe development. |
many ways are there for open the file : > A file can be opened using the constructor function of the class . and > using the member function open () of the class. |
A file name includes a primary name and an optional period with an extension. |
it cannot read multiple words. |
Strem classes are bassicaly a hierarchy of classes which are used to deal with console and disk files using different streams are called stream classes. |
Its a type of interface b/w the program and the input/output devices is called a stream. Types of Streams : Input Stream : The source stream which sends data to the program is called input stream. Output Stream : The destination stream which receives output from the program is called output stream. |
Callback function is the type of pointer for a function. |
�Do-nothing� functions bassicaly type of ones a function which are just defined but are not used. |
Abstract Base Classes are classes which cannot be used to create any objects. |
C-style strings are bassially a type of arrays of chars with a little bit of special sauce to indicate where the string ends. And in these type of arrays are also string literals, such as "this". In reality, both of these string types are merely just collections of characters sitting next to each other in memory. and its mainly use for The null terminated character arrays used to store and manipulate strings . |
Run time polymorphism is bassically called as Binding of an object to the corresponding function at run time.its a method overriding. It takes place at runtime and looks peticular to the object type. |
Pointer constants is bassically a term in the memory addresses in a computer which is cannot be changed. |
Pointer Variables is the bassically that Variables which is hold memory addresses.That variable called pointer variables. |
Overriding is bassically a Providing a declaration which matches another declaration of the same name, thereby hiding the existing declaration. And its a ability to change the definition of an inherited method or attribute in the derived class. |
Containership is bassically type of hierarchy. It can also be called containment hierarchy. In C++ Possessing of objects of other classes in a class is called containership or nesting. |
How are prefix and postfix versions of operator++() differentiated? |
In the Opertor ++() have a dummy paprameter of Post fix version but in case of prefix version its doesn't have. |
�*� operator is using for deference that's why we can called as deferece operator or indirection operator. |
main roles are there : > As a resource manager > As a virtual machine |
Lit is there : > GEMSTONE/OPAL of Gemstone systems, > ONTOS of Ontos, > Objectivity of Objectivity Inc, > Versant of Versant object technology, > Object store of Object Design, > ARDENT of ARDENT software, > POET of POET software. |
What is the difference b/w const char *myPointer and char *const myPointer? |
Diff are there : > Const char *myPointer is a non constant pointer to constant data.But in the case of char *const myPointer is a constant pointer to non constant data. |
Copy Constructor is defined as : > A constructor function with the same name as the class > Used to make deep copy of objects. > Initializes object member variables with another object of the same class. > A New object from an existing one by initialization. |
There are many important places where a copy constructor is called. > When an object is created from another object of the same type. > When an object is passed by value as a parameter to a function. > When an object is returned from a function. > when a function returns an object of that class by value. > when the object of that class is passed by value as an argument to a function. > when we construct an object based on another object of the same class. > When compiler generates a temporary object. |
Conversion Constructor is bassically related to typecasting of user defined datatypes ie Convertion of one class object to other class object. Constructor with a single argument makes that constructor as conversion constructor and it can be used for type conversion. |
Conversion operators bassically is a method. its convert an object from one type to another type. Class can have a public method for specific data type conversions. |
Conversion operator bassically two type are there: > Impliit Conversion - Its operators do not require a type cast to be specified in source code to perform the conversion. > Explicit Conversion - Its operators require a type cast be present in the source code to perform the conversion. |
What are the access privileges in C++? What is the default access level? |
The access privileges in C++ are : > private > public and > protected. The default access level assigned to members of a class is private. Private members of a class are accessible only within the class and by friends of the class. Protected members are accessible by the class itself and it's sub-classes. Public members of a class can be accessed by anyone. |
One can link to code compiled by a C compiler becouse it will be turn off "name mangling" for function. |
When we call "delete this" then two cases are generate in the code . First, if it executes in a member function for an extern, static, or automatic object, the program will probably crash as soon as the delete statement executes. There is no portable way for an object to tell that it was instantiated on the heap, so the class cannot assert that its object is properly instantiated. Second, when an object commits suicide this way, the using program might not know about its demise. As far as acc to the instantiating programme, the object remains in scope and continues to exist even though the object did itself in. Subsequent dereferencing of the pointer can and usually does lead to disaster. |
C++ storage classes are there: > Auto > Register > Static > Extern |
Auto Storage Class is bassically the default. Variables are automatically created and initialized, When they are defined and are destroyed at the end of the block containing their definition. They are not visible outside that block. |
Register Storage Class in C++ bassically is a type of auto variable. A suggestion to the compiler to use a CPU register for performance. |
Static Storage Class is bassicaly a variable that is known only in the function that contains its definition but is never destroyed and retains its value between calls to that function. It exists from the time the program begins execution |
Extern Storage Class is bassically a static variable whose definition and placement is determined when all object and library modules are combined or linked to form the executable code file. It can be visible outside the file where it is defined. |
The macro is expanded without any special type checking.Its expanded by the prepocessors. And It will show up in expanded form during debugging. If macro parameter has a postion incremented variable ( like c++ ), the increment is performed two times.Because compiler error messages will refer to the expanded macro, rather than the macro definition itself. |
Constructor maily use to creates an object and initializes it. Its also use in creates a vtable for virtual functions. It is not a method, It is different from other methods in a class. |
How can a base pointer access the members of a derived class? |
Base pointer is only point to the object of derived class but it cannot access the members of the derived class . |
Two Ways are there : > Taking a reference to the function from the DLL instance. > Using the DLL �s Type Library |
Binding of data and functions is bassicaly called as Encapsulation. |
A scope resolution operator is defened as (::), It can be used to define the member functions of a class outside the class. |
What are the conditions that have to be met for a condition to be an invariant of the class? |
Conditions ae there : > The condition should hold at the end of every constructor. > The condition should hold at the end of every mutator (non-const) operation. |
Many diff are there : > Array is collection of homogeneous elements. but in the case of List, Its a collection of heterogeneous elements. > For Array memory allocated is static and continuous. but for List memory allocated is dynamic and Random. > Array is User need not have to keep in track of next memory allocation.but in List, User has to keep in Track of next location where memory is allocated. |
A node class is a class that is defined as : > Relies on the base class for services and implementation, > It Provides a wider interface to the users than its base class, > It Relies primarily on virtual functions in its public interface. >It Depends on all its direct and indirect base class. > It can be understood only in the context of the base class. > It can be used as base for further derivation. > It can be used to create objects. > A node class is a class that has added new services or functionality beyond the services inherited from its base class. |
Define a constructor - What it is and how it might be called (2 methods). |
Constructor is atype of member function in the class, with the name of the function being the same as the class name. It also specifies how the object should be initialized. There are two Ways of calling constructor: > Automatically by complier when an object is created. It is called a Implicitly method. > Calling the constructors explicitly is possible, but it makes the code unverifiable. |
when we can do the Echo RANDOM. Then we got return a undefined variable. > If we are from the C-Shell, just we will got return value prompt, > If we are from the Bourne shell, and in a 5 digit random numbers. > If we are from the Korn shell. We could also do a ps -l and look for the shell with the highest PID. |
When main() isn't invoked C++ allows for dynamic initialization of global variables. It is possible that global initialization will invoke some function. When main() is not entered this function crashes the crash will be occur. Non-static const data members and reference data members cannot be assigned values; instead, We should use initialization list to initialize them. |
It is bassically using for traversing the index of array thats The Real power of arrays , Accessing each element with the same expression a[i]. All the is needed to make this work is a iterated statement in which the variable a[i] serves as a counter, incrementing from 0 to a.length -1. |
Its not a actually members of the class it cn access only private and protected member of the class .The function acts as a friend to a class. As a friend of a class, it must be listed in the class definition. |
Abstraction is the bassically type of process, It is the process of hiding the details and exposing only the essential features of a particular concept or object. |
At the end of the object scope It declares an object with automatic storage duration. Which object will be destroyed. Many variables in functions that are not declared as static and not dynamically allocated have automatic storage duration by default. Local variables which is Local but they are not declare within a scope; They are often called automatic variables because they automatically come into being when the scope is entered and automatically go away when the scope closes. The keyword auto makes this explicit, It is never necessary to declare somethin becouse local variables are default. |
An internal iterator is working on stp by step, Its implemented with member functions of the class .An external iterator is implemented as a separate class that can be "attach" to the object that has items to step through. An external iterator has the advantage : > that many difference iterators can be active simultaneously on the same object. |
Its is type of memeber which one that can be modified by the class even when the object of the class or the member function doing the modification is const. |
Tree-style hierarchy is type of a method and system is provided for generating a tree-style graphical representation that depicts simultaneously hierarchical and non-hierarchical interrelationships among a set of entities. There is two sets of specifications are acquired. One set describes a set of hierarchical interrelationships. The other set describes a set of non-hierarchical interrelationships among the same set of entities. Based on the two sets of specifications,The generated tree-style graphical representation is displayed, as a graphical user interface, on a display device. |
Isostream is better than stdio like that : > The |
Many uses of Private Inheritance : > It can introduce unnecessary multiple inheritance . > It allows members of Car to convert a Car* to an Engine*. > It allows access to the protected members of the base class. > It allows Car to override Engine's virtual functions. > This makes it slightly simpler to give Car a start() method that simply calls through to the Engine's start() method. |
Many diff are there in strut and a class .class members is a private by default but in case of struts members are by default public. ans the class is a C++ element and struct is a C one. We can have functions, virtual functions, inheritance, different access modifiers private, protected, public in a class but probably not in a struct. A struct generally holds member variables only." |
A constructor initializer list is the bassically syntactical construct, It allows the user to specify to the compiler how to initialize member variables of a class upon construction of an instance of that class. |
A Explicit construtor is bassically means a conversion constructor always declared with the explicit keyword. The compiler does not use an explicit constructor to implement an implied conversion of types. It�s purpose is reserved explicitly for construction. |
Adavantages of Inheritance are there: > It permits code reusability. > Its saves time in program development. > It encourages the reuse of proven and debugged high-quality software, thus reducing problem after a system becomes functional. |
STL is a bassically standard librry templates whihc is approved by ANSI C++ specification. Its Library contains have a many templates which is also appoved by them. A programmer launches into a discussion of the generic programming model, iterators, allocators, algorithms, and such, has a higher than average understanding of the new technology that STL brings to C++ programming. |
A Nested class is bassically a normal class which is enclosed within the scope of another class. It is mainly declared within the scope of another class. The name of a nested class is local to its enclosing class. Unless you use explicit pointers, references, or object names, declarations in a nested class can only use visible constructs, including type names, static members, and enumerators from the enclosing class and global variables. |
What are the defining traits of an object-oriented language? |
The defining traits of an object-oriented langauge are there : > encapsulation > inheritance > polymorphism |
We can access the static member of the class in this syntax : |
Many DIff are there : > In C Structure is bassically used to bundle different type of data types together to perform a particular functionality. But In case of C++ extended the structure to contain functions also. The major difference is that all declarations inside a structure are by default public. And we are talking about the class, It is a successor of Structure. By default all the members inside the class are private. |
The Name of operatores are there which can nt be overladed ....... > sizeof, > [.] > * > - > :: > ?: |
What is the difference between static link library and dynamic link library? |
Basic diff are there : > Static libraries are linked at compile time. > Dynamic libraries are linked at runtime. |
Pulse code modulation is decribed as a PCM .Now a Days we know its a digital world In this time it is the heart of technology in communications . It�s a process in which analog signals are converted to digital form. The analog signal is represented by a series of pulses and non-pulses. At this stage to fully understand we can refer back to the notes on signals. |
we know that PCM is digital, A more general reason would be that digital signals are easy to process by cheap standard techniques. PCM bassically use for other processes : > Filtering > Sampling > Quantizing > Encoding |
A smart pointer is a type of pointer but its an smart. It ia an abstract data type that simulates a pointer while providing additional features, such as automatic garbage collection. In the smart pointer have a very most imp features in the pointers and its have additional features are intended to reduce bugs caused by the misuse of pointers while retaining efficiency. Smart pointers typically keep track of the objects that point to them for the purpose of memory management. |
What is the difference between static link library and dynamic link library? |
Many diff are there : Static Link Library : Static linking is the abssicaly a type of method, It is a original method used to combine an application program with the parts of various library routines. The linker is given your compiled code, containing many unresolved references to library routines. |
Multithreading is defined as :It is the task of creating a new thread of execution within an existing process rather than starting a new process to begin a function. It is the ability of an operating system to concurrently run programs that have been divided into subcomponents, or threads. |
The placement-new operator constructs an object on a pre-allocated buffer. The pre-allocated buffer has to be allocated on the heap. Operator new allocates memory from the heap, on which an object is constructed. Standard C++ also supports placement new operator, which constructs an object on a pre-allocated buffer. This is useful when building a memory pool, a garbage collector or simply when performance and exception safety are paramount. |
Inheritance is a bassically can be private , public, or virtual. With virtual inheritance there is only one copy of each object even if the object appears more than once in the hierarchy. |
An iterator is a bassically a type of object that represents a stream of data. It is Unlike a sequence, an iterator can only provide the next item. The for-in statement uses iterators to control the loop, and iterators can also be used in many other contexts. |
Constructor Initializer List is a bassically a use for a some valid values.Its Main purpose of the contstuctor is to initialize the data members with some valid values.This can be done in two ways : > To initialise a const > To initialise a reference |
Modelling Language is the bassically is type of artificial language .It is manily use for a expree the information or knowledge or system in a structure, that is defined by a consistent set of rules.The rules are used for interpretation of the meaning of components in the structure. It is used for the the mainly some purposes : > Graphical modeling languages use a bassically diagram techniques with named symbols that is represent concepts and lines that connect the symbols and that represent also relationships and various other graphical annotation to represent constraints. > Textual modeling languages typically use standardised keywords accompanied by parameters to make computer-interpretable expressions. |
Generalisation is the bassically type of Inheritance. But it is a diff from each other. Generalization is the mainly describes the relationship; Inheritance is the programming Lnaguage It is implementation of generalization�it is how we manifest generalization in code. Generalization implies that the derived object is a subtype of the base object. Its have a one type of account which is called as checking account .It is a bank account. Its relationship is symmetrical: Bank account generalizes the common behavior and attributes of checking and savings accounts. |
Assocaiation bassically called as third party whihc is creat a relatoionship of the commonly captured in the domain analysis is a simple association. An association suggests that two objects know of one another and that the objects interact in some way. An association is a mainly structural relationship that indicates that objects of one classifier, whihc classifier is a class and interface,That are connected and can navigate to objects of another classifier. |
The visualization is the bassically a way of presentation ,Its just a fancy name for the diagrams, pictures, screen shots, prototypes, and any other visual representations created to help through and design the graphical user interface of your product. |
CRC basically a card but its uses in many fields which is mentioned are there, Its stands for Class, Responsibility, and Collaboration. A CRC card is nothing more than a 4x6 index card. This is a very simple, low-tech device allows you to work with other people in understanding the primary responsibilities of our initial set of classes. We assemble a stack of blank 4x6 index cards and meet around a conference table for a series of CRC card sessions. CEC cards are used to identify classes, responsibilities and collaborations between the objects in an object-oriented system. |
CRC Cards are very useful thing but its also have Many limitations which are there : > its a inherent limitations > Its also don�t capture the interrelationship among classes. > the nature of the collaboration is not modeled well. > CRC cards also don�t capture attributes. > CRC cards do not capture this information. |
Interaction diagrams is bassicaly a type of model . Models behavior of use cases by describing the way groups of objects interact to complete the task. And The two kinds of interaction diagrams are sequence and collaboration diagrams.In this case that can dramatically improve the documentation and understanding of the intraction. |
Interaction diagrams are bassicaly used for the mdels behavior when models are work in the saeveral objects in a use case. They are reprasented how the objects collaborate for the behavior. Interaction diagrams do not give a in depth representation of the behavior. If we want to know what a specific object is doing for several use cases use a state diagram. Then we got particular behavior over many use cases or threads use an activity diagrams. |
Class diagrams are bassically use for explain the classes in the terms of diagram.It serve two purposes: > to represent the static state of classes and > to exploit. the relationships between those classes. In the early stages of the software development life cycle, it is important to note that the class diagram model attempts not only to define the public interface for each class but to define the associations, aggregations, and generalizations defined between the individual classes. |
A Realization is a type of relationship , It is a relationship between two model elements, in which one model element or the client realizes the behavior that the other model element or the supplier specifies. A realization is displayed in the diagram editor as a dashed line with an unfilled arrowhead towards the supplier. |
A Utility class is bassicaly a class that contains grouped functionality. But no persistent data members or attributes. Although utility classes are not part of standard C++, some programmers like to create them. The UML offers support for them. The purpose of a utility class is to take a set of functionality and group them together in a common class. There is no need to create an instance of this class because each function in the class is declared static: We can simply use the functions contained in the class by fully qualifying the desired function name. |
The Memory Leak is bassically a term of the memory . The Term memory leak is quite popular in the industry, But it isn�t often explained. Here�s the idea: If you allocate memory using new and fail to reclaim that memory using delete, the memory is irretrievably lost until your program ends. It is as if the memory �leaked out� of your program. |
A Deque is bassically a type of vector .It is like a double-ended vector, It inherits the vector container class�s efficiency in sequential read and write operations. But in case of addition, the deque container class provides optimized front-end and back-end operations. These type of operations are same as implemented they are in the list container class, where memory allocations are engaged only for new elements. This feature of the deque class eliminates the need to reallocate the whole container to a new memory location, as the vector class has to do. Even deques are ideally suited for applications in which insertions and deletions take place at either one or both ends, and for which sequential access of elements is important. |
A Multimap is similar to a map except that elements can have duplicate keys. Even the multimap class has a similar class definition to the map container class, W ith some exceptions. It has no subscripting operators because there may be more than one element that has the same key value. The insertion operation is always okay because duplicate keys are allowed. |
An input iterator is an iterator that must satisfy the following set of requirements which is there : > Default Constructible: The iterator must have a default constructor so that it can be created without initializing it to any particular value. When an input iterator is created using its default destructor, It is an invalid iterator. It remains invalid until it is assigned a value. > Assignable: The iterator must have a copy constructor and an overloaded assignment operator. These features allow for copying and assigning values to iterators. > Equality Comparable: The iterator must have an overloaded equality operator == and an inequality operator !=. These operators allow for the comparison of two iterators. |
A Heap is a sequence in which the element with the largest value is always the first element in the sequence. Elements are pushed into and popped out of the heap only at the front of the sequence. The STL priority queue is usually implemented as a heap. The Standard Library provides two heap-to-sequence conversion operations and two heap element access operations. |
Recursion is when a thing refers to itself or to an image just like itself. For a function, recursion means that the function calls itself. For an object,Recursion is when the object refers to things like itself by means of a pointer or a reference. Often, recursive structures and recursive functions go hand in hand. The best way to do many of the common operations on recursive structures is to use a recursive function. |
The hash function is an important part of the hashing technique. This function is used to transform the keys into table addresses. The hash function we choose should be easy to compute and should be able to transform the keys into integers in the range 0 to TR-1. Because most of the commonly used hash functions are based on arithmetic operations, We should convert the keys to numbers on which arithmetic operations can be performed. |
The Chaining technique basically looks at the hash table as an array of pointers to linked lists. Each slot in the hash table is either empty or simply consists of a pointer to a linked list. You resolve collisions by adding the elements that hash to the same slot to the linked list to which that slot points. At the same time, deletions are easy, You simply delete elements from the linked list. |
The Bucket Addressing Technique is similar to chaining in that collision resolution is performed by using additional space. Whenever instead of using linked lists, We make use of buckets. A bucket can be defined as a block of space that can be used to store multiple elements that hash to the same position. In this method, We must give the buckets a fixed size; The Choice of this size can sometimes be tricky. Collisions are still possible because you may fill a bucket completely�in which case the key must be stored somewhere. This storage location can be an available bucket or an overflow area. A variation can be used to eliminate the need for buckets with fixed size: We can allow each bucket to contain a pointer to a dynamically allocated array. |
The Performance problem encountered by linear probing is caused by the cluster buildup That occurs as a result of the probing sequence. Quadratic probing uses a different sequence to avoid primary clustering. |
Parsing is a generic operation that identifies legal expressions and breaks them up into a form suitable for further processing. Parsing has applications in many different fields such as computer science, Interpreting human language, and so on. The main goal of parsing is to check the validity of an expression and make more sense out of it. The term �grammar� is commonly used in programming languages to identify legal expressions. There are two approaches commonly used during parsing of these two methods : > Top-down approach: This method looks at the program first, and recursively identifies parts that are eventually matched to the input expression. > Bottom-up approach: This method looks at the input expression and combines the pieces of the expression to make a legal program from it. |
Numeric expressions are generally represented by the infix notation, In which the operator is placed between the operands and parentheses are used where necessary to indicate the order in which the operators are applied to the Expressions. Numeric expressions are best computed using a postfix notation also called reverse polish notation, In which the operator is placed after its two operands and parentheses are not required. |
The B-tree was invented in 1972 by R. Bayer and E. McCreight, and was designed from the start to create shallow trees for fast disk access. Shallow trees have few �levels�, We have to seek through them fewer times, and therefore they run quickly. Because seeks often require going to disk for the information we need, The performance increase with a shallow tree rather than a deeper tree can be substantial. B-trees are a powerful solution to the problem of disk-based storage; virtually every commercial database system has used variations on a B-tree for years. A B-tree consists of pages. Each page has a set of indices. Each index consists of a key value and a pointer. The pointer in an index can point either to another page or to the data you are storing in the tree. Thus, every page has indices that point to other pages or to data. If the index points to another page, the page is called a node page; If the index points to data, the page is called a leaf page. |
can derived clss exception also be caught by the catch block? |
No |