So if i want to write a regular string to a text doc, i would do this...
That works fine and all, the word 'hello' is printed into the document. But i want to be able to write the value of a variable into a text document, and when i try this...Code:TFileStream *FStream; FStream = new TFileStream("tester.txt",fmOpenWrite); FStream->Write("hello",5);
...it writes some weird symbols to the document, instead of 20. i'm using borland c++ builder 5 btw. anyone have any tips/suggestions/advice/etc?Code:int x=20; TFileStream *FStream; FStream = new TFileStream("tester.txt",fmOpenWrite); FStream->Write(x,5);
Things i've tried already...
- changing the second arguement of Write() to different numbers other than 5, still writes the same thing
- searching the help file in my IDE for functions similar to Write() that may do what i want, but none of them worked either