C Basic Concepts
- We cannot apply indirection operator to void pointer. (101)
- Check question 33,47,49,54,67,79,85,90,94,99,101,104,106, 112, 117, 121,152,160,174,51 again
- We cannot apply bitwise shift operator or mod operation to float variables
- If the structure is globally declared all the variables are initialized to zero.
- When passing array to function, function parameter is implemented as pointer only(94)
- Function name preceded by 'pascal' keyword refers to pascal passing mechanism (left to right) while in 'cdecl' variables are passed from right to left (111)
int* arr[8]; // An array of int pointers.
int (*arr)[8]; // A pointer to an array of integers (http://stackoverflow.com/questions/859634/c-pointer-to-array-array-of-pointers-disambiguation)- Macros can be re-define anywhere in the program
- In C, Unary + is a dummy operator.
- Enumeration constants cannot be modified(113)
- We cannot create a variable of type void.
- If a name is not known pre-processor treats it as equal to zero (119)
- & ( Address of ) Operator is not applicable for register variable (139)
- Small-endian ( Lower order bytes are stored in higher memory address and Higher order bytes are stored in Lower memory address). Eg: 300 Binary Representation is - 00000001 00101100. In memory it is stored as 00101100 00000001.
- Forward declaration is not allowed in c (154,155)
- The values of any type tend to rotate after a particular value Eg; for 'char' after 127 it moves to -128.
- Character constants are stored in code/data area. They are not stored in stack. So there might not be dangling pointer issue
- Initializing structure variable inside structure is not allowed
- Arrays are non-modifiable Lvalue
- When two strings are placed together they are concatenated,this is know as stringization
- Empty object size is always one.
- Function overloading cannot be resolved based on return type alone.
- Expression will not be evaluated inside the sizeof operator
- http://stackoverflow.com/questions/501816/why-does-cout-print-char-arrays-differently-from-other-arrays
- http://www.geeksforgeeks.org/storage-for-strings-in-c/
- http://www.geeksforgeeks.org/swap-strings-in-c/
- In C, when we initialize less no of elements in an array all uninitialized elements become ‘′ in case of char and 0 in case of integers. ( http://geeksquiz.com/string/ Question 8 )
- In C, struct and union types cannot have static members.
- http://geeksquiz.com/structure-union/ (last Question )
- http://geeksquiz.com/dynamic-memory-allocation/ (Third Question)
- In C, static variables can only be initialized using constant literals. This is allowed in C++ though (http://www.geeksforgeeks.org/g-fact-80/)
- http://www.geeksforgeeks.org/are-array-members-deeply-copied/
- In C and C++ arguments are passed by value by default
- http://www.learncpp.com/cpp-tutorial/123-virtual-destructors-virtual-assignment-and-overriding-virtualization/
Constant Object
- The member variables cannot be changed.
- It can access only constant member functions and constant member variable int that class.
Constant Member Function
- The state of the object cannot be changed inside the constant member function
- Variable declared as mutable can be changed.
Static variables
- Created and initialized only once.
- Shared among all members.
Static Functions
- Can access only static members of the class
- Cannot access other members.
- Can be called without using objects and can be called using objects also
No comments:
Post a Comment