what is the difference between class and structure in C++?

Answer Posted / vijayendra singh chand

The main difference between class and structure is that
class is reference type whereas structure is value type.

Is This Answer Correct ?    5 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is abstraction oop?

807


What does sksksk mean in text slang?

1804


This program numbers the lines found in a text file. Write a program that reads text from a file and outputs each line preceded by a line number. Print the line number right-adjusted in a field of 3 spaces. Follow the line number with a colon, then one space, then the text of the line. You should get a character at a time and write code to ignore leading blanks on each line. You may assume that the lines are short enough to fit within a line on the screen. Otherwise, allow default printer or screen output behavior if the line is too long (i.e., wrap or truncate). A somewhat harder version determines the number of spaces needed in the field for the line numbers by counting lines before processing the lines of the file. This version of the program should insert a new line after the last complete word that will fit within a 72-character line.

1838


Why do we need polymorphism in c#?

857


Which is better struts or spring?

785






#include #include #include #include void select(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); select(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void select(char *items, int count) { register int a, b, c; int exchange; char t; for(a = 0; a < count-1; ++a) { exchange = 0; c = a; t = items[ a ]; for(b = a + 1; b < count; ++b) { if(items[ b ] < t) { c = b; t = items[ b ]; exchange = 1; } } if(exchange) { items[ c ] = items[ a ]; items[ a ] = t; } } } design an algorithm for Selection Sort

2299


What are the benefits of oop?

829


What are the benefits of polymorphism?

837


i=20;k=0; for(j=1;k-i;k+=j<10?4:3) { cout<

1623


What is a class oop?

744


What is a null tree?

832


Why is oop better than procedural?

785


How does polymorphism work?

842


What is protected in oop?

787


Write a c++ program to display pass and fail for three student using static member function

3059