since the function fn() is returning "bool"(here "true " which is of one byte ) value whose size is 1 byte in C so your output is showing 1 .
if you change the return type of your function ..say "int " it will print 4 byte (size of integer on your machine ).or say double it will print 8 byte (size of double on your machine ) On Fri, Aug 31, 2012 at 9:25 PM, Rahul Kumar Patle < patlerahulku...@gmail.com> wrote: > #include<stdio.h> > #include<stdbool.h> > > bool fn(char *a , int b , char c) > { > return true; > } > > int main() > { > int it = 2; > char ct = 'c'; > char a[30]; > printf("%d\n",(sizeof(fn(a , it , ct)))); > } > > in gcc 32 bit compiler the above code is always printing 1 even if i > change the no of argument in fn() > why?? pls explain.. > > > > -- > Thanks and Regards: > Rahul Kumar > Patle<http://www.linkedin.com/profile/view?id=106245716&trk=tab_pro> > M.Tech, School of Information Technology > Indian Institute of Technology, Kharagpur-721302, > India<http://www.iitkgp.ac.in/> > Mobile No: +91-8798049298, +91-9424738542 > Alternate Email: rahulkumarpa...@hotmail.com > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- *RAHUL KUMAR DUBEY* *BTech-3rd year * *Computer Science &Engineering * *Motilal Nehru National Institute Of Technology* *Allahabad[211004],UP.* -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.