Friday 6 September 2013

Subtracting two strings in C

Subtracting two strings in C

Well , I was actually looking at strcmp() , was confused about its working
. Anyways I wrote this code
#include <stdio.h>
main()
{
char a[5] = "ggod";
char b[5] = "ggod";
int c = 0;
c = b - a;
printf("%d value", c);
}
and I get the output as
16
Can anyone explain Why is it 16 ?

No comments:

Post a Comment