I guess the word got a little too confusing... :) I just meant that even thou the call-by-reference feature is not there in C. We can use pointers to get similar results.
Regards, Sandeep Jain On Thu, Aug 4, 2011 at 10:43 AM, Tushar Bindal <[email protected]>wrote: > we know all these definitions. > > but i think the doubt was regarding the word simulate as we consider call > by reference an internal part of C > but your statement means that it is a concept of C++, but we just simulate > it in C using pointers. Am I correctly interpreting it? > > > On Thu, Aug 4, 2011 at 10:38 AM, Sandeep Jain <[email protected]>wrote: > >> We can say call-by-reference is where changes in formal parameters are >> reflected in actual parameters. >> call-by-value is where changes in formal parameters are not reflected in >> actual parameters. >> However when u have something like >> >> int x=10; >> f(&x); >> >> void f(int *p){ *p = 20;} >> changes in p(formal parameter) won't be reflected in &x (actual parameter) >> However changes in *p are reflected in x, using this the caller's variable >> is getting modified by the callee. >> >> >> Regards, >> Sandeep Jain >> >> >> >> >> On Thu, Aug 4, 2011 at 10:19 AM, Shashank Jain <[email protected]>wrote: >> >>> @sandeep, i dint get what do you mean by simulate here, as in an example >>> wud be gud. >>> >>> Shashank Jain >>> Delhi College of Engineering >>> >>> >>> >>> On Wed, Aug 3, 2011 at 11:34 PM, Sandeep Jain <[email protected]>wrote: >>> >>>> I'd say C language is a truly call-by-value language. C++ supports >>>> call-by-reference. >>>> However in C we can "simulate" call-by-reference using pointers and >>>> address-of operator. >>>> >>>> >>>> Regards, >>>> Sandeep Jain >>>> >>>> >>>> >>>> >>>> On Wed, Aug 3, 2011 at 11:27 PM, NITIN SHARMA <[email protected] >>>> > wrote: >>>> >>>>> As we say in C that we do call by reference but i thk call by >>>>> reference is something different like we do through "void pointer" in c >>>>> ++ but it should be call by address in C is it so????? >>>>> >>>>> -- >>>>> 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. >>> >> >> -- >> 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. >> > > > > -- > Tushar Bindal > Computer Engineering > Delhi College of Engineering > Mob: +919818442705 > E-Mail : [email protected] > Website: www.jugadengg.com > > -- > 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.
