What is the difference between Class and Structure?
Answer Posted / eshetu
1. IN STRUCTURE THE DATA MEMBER BY DEFAULT IS PUBLIC BUT IN
CLASS THE DATA MEMBER ARE PRIVATE.
2. THE STRUCTURE ONLY CONTAIN DATA MEMBER BUT CLASS CONTAIN
DATA MEMBER & MEMBER FUNCTION.
3.IN STRUCTURE THE STRUCTURE NAME CAN'T STAND ALONE.BUT THE
CLASS NAME CAN STAND ALONE.
| Is This Answer Correct ? | 10 Yes | 5 No |
Post New Answer View All Answers
Carry out conversion of one object of user-defined type to another?
What are default parameters? How are they evaluated in c++ function?
What is a wchar_t in c++?
What is a singleton c++?
What are the rules about using an underscore in a c++ identifier?
What is the best c c++ compiler for windows?
What is class in c++ with example?
Explain the concept of dynamic allocation of memory?
What do you mean by translation unit in c++?
What is virtual destructor ans explain its use?
A prime number is a number which is divisible only by itself and 1. Examples of the first few primes are 2, 3, 5, 7, 11. Consider writing a program which can generate prime numbers for you. Your program should read in and set a maximum prime to generate and a minimum number to start with when looking for primes. This program should be able to perform the following tasks: 1. Read the maximum number from user (keyboard input) to look for primes. The program should not return any primes greater than this number. 2. Read the minimum number from user (keyboard input) to look for primes. The program should not return any primes less than this number. 3. Generate and print out every prime number between the maximum prime and minimum number specified by the user.
What is the copy-and-swap idiom?
Out of fgets() and gets() which function is safe to use and why?
What are manipulators used for?
Is the declaration of a class its interface or its implementation?