Answer Posted / abalonesoft
A class defines a data type, much like a struct would be in
C. In a computer science sense, a type consists of both a
set of states and a set of operations which transition
between those states. Thus int is a type because it has both
a set of states and it has operations like i + j or i++,
etc. In exactly the same way, a class provides a set of
(usually public) operations, and a set of (usually
non-public) data bits representing the abstract values that
instances of the type can have.
You can imagine that int is a class that has member
functions called operator++, etc. (int isn't really a class,
but the basic analogy is this: a class is a type, much like
int is a type.)
Note: a C programmer can think of a class as a C struct
whose members default to private. But if that's all you
think of a class, then you probably need to experience a
personal paradigm shift.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.
What is the best way to store flag values in a program?
What is static volatile in c?
What will be the outcome of the following conditional statement if the value of variable s is 10?
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
can any one provide me the notes of data structure for ignou cs-62 paper
What are the applications of c language?
What is c preprocessor mean?
What are predefined functions in c?
When is a void pointer used?
A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?
What is enumerated data type in c?
What is unsigned int in c?
What is wild pointer in c?
What is sizeof in c?