What is the difference b/w Structure & Class?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / mohan chaudhari
1.In structure there is no data encapsulation.
but in class, there is data encapsulation.
2.Data member in structure are not private .
In class they are private.
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / alekhya
1.in structure we have only data members where as
in class we have members and member functions
2.in class we declare members with access specifiers like
private,public...
in structs we dont have any access specifiers all the
members of structure are pubic
| Is This Answer Correct ? | 1 Yes | 0 No |
Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)
how to execute a program using if else condition and the output should enter number and the number is odd only...
What does %p mean c?
Where are local variables stored in c?
How many types of linked lists what are they? How many types of data structures?
18 Answers BSNL, Pivotal Software,
What is the difference between static and global variables?
what is a far pointer
12 Answers ABB, DRDO, ITI, Maruti Suzuki, Steel Plant, TCS, Toyota, Vivo Mobiles,
Which is better pointer or array?
What is the size of enum in c?
What is the meaning of 2d in c?
without a terminator how can we print a message in a printf () function.
A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?