Ask questions which are clear, concise and easy to understand.
Ask QuestionPosted by Rishu Kumar 7 years, 1 month ago
- 0 answers
Posted by Mayank Garg 7 years, 1 month ago
- 0 answers
Posted by Motiar Rehman 7 years, 1 month ago
- 0 answers
Posted by Fatima Mm 7 years, 1 month ago
- 0 answers
Posted by Gaurav Bahukhandi 7 years, 1 month ago
- 0 answers
Posted by Aditi Parth 7 years, 1 month ago
- 1 answers
Mayank Joshi 7 years, 1 month ago
Posted by Neeraj Chandra 7 years, 1 month ago
- 0 answers
Posted by Shubham Agrawal 7 years, 1 month ago
- 0 answers
Posted by Harsh Goyal 3 years, 5 months ago
- 1 answers
Sia ? 3 years, 5 months ago
Classes are of reference types. | Structs are of value types. |
All the reference types are allocated on heap memory. | All the value types are allocated on stack memory. |
Allocation of large reference type is cheaper than allocation of large value type. | Allocation and de-allocation is cheaper in value type as compare to reference type. |
Class has limitless features. | Struct has limited features. |
Class is generally used in large programs. | Struct are used in small programs. |
Classes can contain constructor or destructor. | Structure does not contain parameter less constructor or destructor, but can contain Parameterized constructor or static constructor. |
Classes used new keyword for creating instances. | Struct can create an instance, with or without new keyword. |
A Class can inherit from another class. | A Struct is not allowed to inherit from another struct or class. |
The data member of a class can be protected. | The data member of struct can’t be protected. |
Function member of the class can be virtual or abstract. | Function member of the struct cannot be virtual or abstract. |
Two variable of class can contain the reference of the same object and any operation on one variable can affect another variable. | Each variable in struct contains its own copy of data(except in ref and out parameter variable) and any operation on one variable can not effect another variable. |
Posted by Gayathri Seetharaman 7 years, 1 month ago
- 2 answers
Vaibhav Tripathi 7 years, 1 month ago
Posted by Shray Rastogi 7 years, 1 month ago
- 0 answers
Posted by Deepika Joshi 7 years, 1 month ago
- 0 answers
Posted by Deepika Joshi 7 years, 1 month ago
- 0 answers
Posted by J Ranjan Parida 7 years, 1 month ago
- 0 answers
Posted by Maitryee Gol 3 years, 5 months ago
- 1 answers
Sia ? 3 years, 5 months ago
Const is a declaration of constant, compiler will do appropriate checks during the compile time
#define is a macro compiler will see a value.
Speaking in terms of memory const declaration could be more efficient:
const short x =3D 1;=20
// this will allocate 16 bits for x (actually it depends on the machine, I assume unix platform with 32 bits integers)
#define x (short)1=20
// this will probably allocate 32 bits to hold the constant 1.
Use const instead of #define mainly because of compiler checks. And inline functions instead of macros as well. Preprocessor is the obsolete remnant from early C days, there’s no use of it in the oop environment.
Posted by Akshit Jain 7 years, 1 month ago
- 1 answers
Simrandeep Kaur 7 years, 1 month ago
Posted by Adarsh Sagar 7 years, 1 month ago
- 0 answers
Posted by Adith Sharma 7 years, 1 month ago
- 4 answers
Piyush Kumar 7 years, 1 month ago
Simrandeep Kaur 7 years, 1 month ago
Ayush Saxena 7 years, 1 month ago
Posted by Shivang Gupta 7 years, 1 month ago
- 0 answers
Posted by Himanshu Bhimte 7 years, 1 month ago
- 0 answers
Posted by Himanshu Sinha 7 years, 1 month ago
- 1 answers
Sonam Bali 7 years, 1 month ago
SQL stands for Structured Query Language. SQL is used to communicate with a database.
Posted by Pankaj Pandey 7 years, 2 months ago
- 1 answers
Ashish Singla 7 years, 2 months ago
python is a computer programming language like c++, c, java etc.
moreover google is the best platform to ask any query.
Posted by Ritesh Kumar 7 years, 2 months ago
- 1 answers
Amar Kumar 7 years, 2 months ago
A memory leak is a type of resource leak that occurs when a computer program incorrectly manages memory allocations in such a way that memory which is no longer needed is not released. A memory leak is the gradual loss of available computer memory when a program (an application or part of the operating system) repeatedly fails to return memory that it has obtained for temporary use.
Posted by Praveen Gaur 7 years, 2 months ago
- 0 answers
Posted by Ankit Singh 7 years, 2 months ago
- 0 answers
Posted by Vats Ji Mishra 7 years, 2 months ago
- 0 answers
myCBSEguide
Trusted by 1 Crore+ Students
Test Generator
Create papers online. It's FREE.
CUET Mock Tests
75,000+ questions to practice only on myCBSEguide app