const char*p - p is pointer to the constant character. i.e value in that address location is constant.
const char* const p - p is the constant pointer which points to the constant string, both value and address are constants.
Realloc(ptr,n) function uses two arguments.
The first argument ptr is a pointer to a block of memory for which the size is to be altered. The second argument n specifies the new size.The size may be increased or decreased.
A pointer value is a data object that refers to a memory location. Each memory location is numbered in the memory. The number attached to a memory location is called the address of the location.
The typedef help in easier modification when the programs are ported to another machine.A descriptive new name given to the existing data type may be easier to understand the code.
New initializes the allocated memory by calling the constructor. Memory allocated with new should be released with delete.
Malloc allocates uninitialized memory. The allocated memory has to be released with free.new automatically calls the constructor while malloc(dosen't)
Both copy a string. strcpy wants a buffer to copy into. strdup allocates a buffer using malloc(). Unlike strcpy(), strdup() is not specified by ANSI.
The function declaration should be preceded by the keyword friend.The function definitions does not use either the keyword or the scope operator ::. The functions that are declared with the keyword friend as friend function.Thus, a friend function is an ordinary function or a member of another class.
A recursion function is one which calls itself either directly or indirectly it must halt at a definite point to avoid infinite recursion.
are the characteristics of arrays in C are as follows:
1. An array holds elements that have the same data type.
2. Array elements are stored in subsequent memory locations Two-dimensional.
3. Array elements are stored row by row in subsequent memory locations.
4. Array name represents the address of the starting element.
For executing a set of statements fixed number of times we use for loop while when the number of iterations to be performed is not known in advance we use while loop.
printf(....) -------------> is standard output statement sprintf(......)-----------> is formatted output statement.
A conversion constructor 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.Explicit constructors are simply constructors that cannot take part in an implicit conversion.
Compiler allocates memory space for a declared variable. By using the address of operator,the reserved address is obtained and this address is assigned to a pointer variable. This way of assigning pointer value to a pointer variable at compilation time is known as static memory allocation.
c++ ia an object oriented programing but c is a procedure oriented programing.c is super set of c++. c can't suport inheritance,function overloading, method overloading etc. but c++ can do this.In c-programe the main function could not return a value but in the c++ the main function shuld return a value.
A class can inherit properties from more than one class which is known as multiple inheritance.
A function is overloaded when same name is given to different function. While overloading a function, the return type of the functions need to be the same.
A operator is overloaded when same operator name is given to different function. for example '+' operator usually used for adding two integers but we can also use '+' as symbol in string for example "Hello + world".
NULL pointer is a pointer which is pointing to nothing.
int *ptr=(char *)0;
float *ptr=(float *)0;
Pointer variable are initialized in two ways :
1. Static memory allocation
2. Dynamic memory allocation
Copy constructor is a constructor function with the same name as the class and used to make deep copy of objects.
#include‹ › ----> Specifically used for built in header files.
#include " " ----> Specifically used for used for user defined/created n header file.
The dynamic array is an array data structure which can be resized during runtime which means elements can be added and removed.
Macros are abbreviations for lengthy and frequently used statements. When a macro is called the entire code is substituted by a single line though the macro definition is of several lines.
The advantage of macro is that it reduces the time taken for control transfer as in case of function.
The disadvantage of it is here the entire code is substituted so the program becomes lengthy if a macro is called several times.
Auto variables can be stored anywhere, so long as recursion works. Practically, they're stored on the stack. It is not necessary that always a stack exist. You could theoretically allocate function invocation records from the heap.
An array is a repeated pattern of variables in contiguous storage. A linked list is a set of Structures scattered through memory, held together by pointers in each element that point to the next element. With an array, we can (on most architectures) move from one element to the next by adding a fixed constant to the integer value of the pointer. With a linked list, there is a "next" pointer in each structure which says what element comes next.
If a variable is declared with a register storage class,it is known as register variable.The register variable is stored in the cpu register instead of main memory.Frequently used variables are declared as register variable as it's access time is faster.
The run time type identification comes at a cost of performance penalty. Compiler maintains the class.
You can define a member function of a class, called a conversion function, that converts from the type of its class to another specified type.
A pointer value is a data object that refers to a memory location, bach memory location is numbered in the memory. The number attached to a memory location is called the address of the location.
A static function is a function whose scope is limited to the current source file. Scope refers to the visibility of a function or variable. If the function or variable is visible outside of the current source file, it is said to have global, or external, scope. If the function or variable is not visible outside of the current source file, it is said to have local, or static, scope.
If You have any notes which is related to computer science feel free to upload on bcanotes.com . we will publish your notes after revewing it Click Here to upload the file