How does c++ structure differ from c++ class?



How does c++ structure differ from c++ class?..

Answer / Amit Kumar Gupta

A structure in C++ is similar to a class but does not support member functions. In contrast, a class is a user-defined data type that encapsulates data (attributes) and methods (functions).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Do class declarations end with a semicolon? Do class method definitions?

1 Answers  


Do you know about C++ 11 standard?

1 Answers   Agilent, ZS Associates,


What is the difference between an array and a list?

1 Answers  


What are the 3 levels of programming languages?

1 Answers  


What are the advantages of using a pointer?

1 Answers  


Q1 On the screen how do you write the following words? she sells seashells by the seashore (a) all in one line (b) in three lines Q2 Write a program that asks interactively the user’s name and age and responds with Hello name, next year you will be next_age. where next_age is age + 1 Q3 For the different values of n, what is the output? printf(“%x %c %o %d”,n,n,n,n); (a) n = 67 (b) n = 20 (c) n = 128 (d) n = 255 (e) n = 100 Q4 What will be the output of the following program? int main() { char a,b,c; scanf(“%c %c %c”,&a,&b,&c); printf(“a=%c b=%c c=%c”,a,b,c); return 0; } [Note: The user input is:ABC DEF GHI]

1 Answers  


What are guid? Why does com need guids?

1 Answers  


Which is the best c++ compiler for beginners?

1 Answers  


What are shallow and deep copies?

1 Answers  


What is namespace std; and what is consists of?

1 Answers  


Explain the isa and hasa class relationships.

1 Answers  


Describe private, protected and public?

1 Answers  


Categories