Actually you cant take the address. Instead your (void *)printf generates (void *)fprintf and your program core dumps mysteriously at run time