What is the difference b/w Structure & Class?

Answer Posted / srilatha

1.structure contains only data members.
class contains data members and member functions.

2.in structures we can use keyword struct.
in classes we can use keyword class.

Is This Answer Correct ?    5 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is multidimensional arrays

634


Define VARIABLE?

691


how do you execute a c program in unix.

637


How do you determine a file’s attributes?

603


What are the differences between new and malloc in C?

611






What are 3 types of structures?

594


What is hash table in c?

575


What tq means in chat?

583


What is null pointer in c?

596


What is the purpose of 'register' keyword?

692


Write a program for finding factorial of a number.

636


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

770


using only #include and #include Write a program in C that will read an input from the user and print it back to the user if it is a palindrome. The string ends when it encounters a whitespace. The input string is at most 30 characters. Assume the string has no spaces and distinguish between and lowercase. So madam is a palindrome, but MadAm is not a palindrome. Use scanf and %s to read the string. Sample Test: Enter a string: madam madam is a palindrome. Enter a string: 09023 09023 is not a palindrome.

1315


What is || operator and how does it function in a program?

632


write a c program to calculate sum of digits till it reduces to a single digit using recursion

2721