Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.

C Programming :: Dynamic Memory Allocation

Home > C Programming > Dynamic Memory Allocation > General Questions

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

13. What will be result of the following program?

#include
#include
int myalloc(char *x, int n){
x= (char *)malloc(n*sizeof(char));
memset(x,\0,n*sizeof(char));
}
int main(){
char *g="String";
myalloc(g,20);
printf("The string is %s",g);
return 0;
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

Tags:

TCS 

14. What will the following program do?

#include
#include
#include
int main(){
int i;
char a[]="String";
char *p="New Sring";
char *Temp;
Temp=a;
a=malloc(strlen(p) + 1);
strcpy(a,p); //Line no:9//
p = malloc(strlen(Temp) + 1);
strcpy(p,Temp);
printf("(%s, %s)",a,p);
free(p);
free(a);
return 0;
}

Chose correct option

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

Tags:

TCS 

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

16. alloca() allocates memory from

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

17. Output of the code?
FUNC (int *p)
{
p = (int *)malloc(100);
printf("p:%x",p);
}

int main( )
{
int *ptr;
FUNC(ptr);
printf("Ptr:%x",ptr);
return 0;
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Global Edge