pointer has to deal with memory problem, if it is allocated inside the function.
2010/8/17 Benjamin Scott <[email protected]> > > > A return value of Null is a good return value for failure! > However, a Integer indicating how many people records match may be good > too. > > So in your opinion which option is best for your program??? > > --- On Sat, 8/14/10, Alex yu <[email protected] <vitrun%40gmail.com>> > wrote: > > From: Alex yu <[email protected] <vitrun%40gmail.com>> > Subject: [c-prog] return type > To: "c-prog" <[email protected] <c-prog%40yahoogroups.com>> > Date: Saturday, August 14, 2010, 7:51 AM > > > > > provided with a struct: > > struct Person{ > > char name[10]; > > unsigned int id; > > }; > > and a function : > > Person get_person( int) > > if the check in get_person failed, what should get_person return? > > for example > > if(int <0){ > > return #Oh, what should I return? > > } > > [Non-text portions of this message have been removed] > > [Non-text portions of this message have been removed] > > > [Non-text portions of this message have been removed]
