what will happen if we free the same memory two times in C.
for exam........
char *k=(char *)malloc(4);
free(k);
free(k);

>what will happen if we free the same memory two times in C
Undefined behavior. Anything could happen.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.