http://www.cplusplus.com/reference/algorithm/swap/

On Wed, Jul 13, 2011 at 10:40 AM, Aniket Dutta <[email protected]>wrote:

> what about a generic swap function which works for structures also?
>
>
> On Wed, Jul 13, 2011 at 2:23 AM, Don <[email protected]> wrote:
>
>> To check for overflow, use condition:
>>
>> if (b > (maxuint-a))
>>  return error;
>>
>> Where maxuint is the largest value which can be stored in an unsigned
>> integer.
>>
>> Don
>>
>> On Jul 8, 5:50 am, vikas <[email protected]> wrote:
>> > Q1 - write a generic macro to swap two values (int,float,double,pointers
>> as
>> > well )
>> >
>> > Q2 - Implement your own malloc() and  free() function
>> >
>> > Q3 - Two unsigned ints given a, b ....you have add these numbers and
>> return
>> > the sum ...Make sure in case of overflow return "error".
>>
>> --
>> 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.

Reply via email to