there is a lot of difference between declaration and definition ! functions can be declared inside structures in c++ because it is an added extension in c++
On Fri, Aug 5, 2011 at 1:12 AM, sagar pareek <[email protected]> wrote: > same i told u before > > > On Fri, Aug 5, 2011 at 1:07 AM, Ankur Garg <[email protected]> wrote: > >> @Sagar >> >> Pls check the below code ..I found this from google :P >> >> >> http://forums.devshed.com/c-programming-42/declaring-function-in-structure-in-c-545529.html >> >> Guess now u can undestand my question and if possible provide help >> >> >> On Thu, Aug 4, 2011 at 3:33 PM, sagar pareek <[email protected]>wrote: >> >>> @ ankur >>> >>> first tell me diff b/w class and structure in reference to C++; >>> >>> answer is :- >>> in structure all data members are by default public and in class its >>> private >>> >>> all the left characteristics like inheritance, overloading etc can be >>> done on both >>> >>> even u can inherit a structure from a class and vice-verse ... >>> >>> if u dont believe then just try it or google it... >>> >>> so as C is not object oriented hence we cant do things in it as we do in >>> C++ >>> >>> >>> On Fri, Aug 5, 2011 at 12:46 AM, Ankur Garg <[email protected]>wrote: >>> >>>> sorry guys cudnt put question properly :P..my bad ..:(( >>>> >>>> the question i wanted to ask was >>>> >>>> Why cant functions be declared or defined in structures in C but can >>>> be done in C++ ? >>>> >>>> On Thu, Aug 4, 2011 at 2:45 PM, Himanshu Srivastava < >>>> [email protected]> wrote: >>>> >>>>> afcose strcutures can be declared.............classes are not >>>>> declared!!! >>>>> >>>>> >>>>> On Fri, Aug 5, 2011 at 12:13 AM, Dipankar Patro >>>>> <[email protected]>wrote: >>>>> >>>>>> Structures can very well be declared in C: >>>>>> struct student{ >>>>>> char name[20]; >>>>>> int roll; >>>>>> }s1; >>>>>> >>>>>> Are you talking about Classes? >>>>>> >>>>>> >>>>>> On 4 August 2011 23:51, Ankur Garg <[email protected]> wrote: >>>>>> >>>>>>> Why cant structures be declared or defined in C but can be done in >>>>>>> C++ ? >>>>>>> >>>>>>> >>>>>>> What is the reason for this ? >>>>>>> >>>>>>> -- >>>>>>> You received this message because you are subscribed to the Google >>>>>>> Groups "Algorithm Geeks" group. >>>>>>> To post to this group, send email to [email protected]. >>>>>>> To unsubscribe from this group, send email to >>>>>>> [email protected]. >>>>>>> For more options, visit this group at >>>>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> >>>>>> ___________________________________________________________________________________________________________ >>>>>> >>>>>> Please do not print this e-mail until urgent requirement. Go Green!! >>>>>> Save Papers <=> Save Trees >>>>>> >>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "Algorithm Geeks" group. >>>>>> To post to this group, send email to [email protected]. >>>>>> To unsubscribe from this group, send email to >>>>>> [email protected]. >>>>>> For more options, visit this group at >>>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>>> >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Algorithm Geeks" group. >>>>> To post to this group, send email to [email protected]. >>>>> To unsubscribe from this group, send email to >>>>> [email protected]. >>>>> For more options, visit this group at >>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>> >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Algorithm Geeks" group. >>>> To post to this group, send email to [email protected]. >>>> To unsubscribe from this group, send email to >>>> [email protected]. >>>> For more options, visit this group at >>>> http://groups.google.com/group/algogeeks?hl=en. >>>> >>> >>> >>> >>> -- >>> ** >>> Regards >>> SAGAR PAREEK >>> COMPUTER SCIENCE AND ENGINEERING >>> NIT ALLAHABAD >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > > > -- > **Regards > SAGAR PAREEK > COMPUTER SCIENCE AND ENGINEERING > NIT ALLAHABAD > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
