So I'm working on a C++ program and part of it involves converting decimal numbers to hexadecimal. I have been using printf("%02X",number) to do this, but I'd like to print to a text file. Just wondering if anyone knew of a way to send formatted text to file rather than the screen. I've been trying to use fprintf with no luck. Any suggestions would be appreciated. I'll also post code if anyone deems it relevant. Thanks.