TE lacks a bit in the programming front. I mean the discussions.. I request the members to contribute a bit more in this aspect... anyways, I will try to do my bit here... We can share code/logic/what ever and the person who cracks it is allowed to give the second question.
Ahhhh... Instead of calling them questions.. lets call then SNIP from here on..
here is the first SNIP i took from another group,
Take a look..
1) How would free behave?
2) Will the program get executed properly?
PS : 'm sure, Josh will have a crack at this
Ahhhh... Instead of calling them questions.. lets call then SNIP from here on..
here is the first SNIP i took from another group,
Take a look..
Code:
Snip 1
Code:
int main()
{
char *p = malloc(100);
p = "india"; //assuming p is not null
p++;
free(p);
}
1) How would free behave?
2) Will the program get executed properly?
PS : 'm sure, Josh will have a crack at this