Okay ! i found a solution but its really awkward

I found that If I print some thing before I call the fuction it works good FOr example

Code:
 char *buffer = 0;
 char *strr = "LLkLLkbsbsbsbsbs";
 printf("_usename");
  buffer = _replace(strr,"LLk","LOLOLOLOLOLOLOLOLOLOLOLOLOLO :P",buffer);

 printf("%s",buffer);
 getchar();
THis one works but the following one doesn't

Code:
 char *buffer = 0;
 char *strr = "LLkLLkbsbsbsbsbs";
 /*printf("here");*/
  buffer = _replace(strr,"LLk","LOLOLOLOLOLOLOLOLOLOLOLOLOLO :P",buffer);

 printf("%s",buffer);
 getchar();