Friday, April 6, 2012

how to add two pointers

hye, after a long time im writing a post.
todays topic is how to add two pointers.
its very simple and easy.
my college C teacher told me that you cannot add two pointers but after a while i got an idea how to do it.
before reading further i expect that you know type conversion.
 int main(int argc, char *argv[])
 int *a,*b;
 float c =(float)( (unsigned int)a + (unsigned int)b );/*address are unsigned integers( location are positive )*/
 printf("%u + %u = %f",&a,&b,c);
 return 0;
now if your teacher says that you cannot add two pointer,let him see the above code.:)
thank you bye.see you soon.

Labels: , , , , , ,


Post a Comment

Subscribe to Post Comments [Atom]

Links to this post:

Create a Link

<< Home