Re: Any problem ?
Santosh Sivaraj <[email protected]> Fri, 28 Jan 2011 17:32:43 +0530
| Newsgroups | org.kernel.vger.linux-c-programming |
|---|---|
| Message-ID | <[email protected]> |
On 01/28/2011 05:23 PM, ratheesh k wrote:
> void free_it(char *ptr)
> {
> free(ptr);
> }
>
>
> int main()
> {
> char *str = (char *)malloc(100);
> strcpy(str, "Ratheesh");
> free_it(str);
> str=NULL;
> return 0;
> }
Nothing is wrong.. should work fine.
Santosh
--
http://fossix.org