Thread: Coding Inquiry
View Single Post
  #10  
Old April 5th, 2004, 10:04 PM
Will's Avatar

Will Will is offline
Lieutenant Colonel
 
Join Date: Mar 2001
Location: Emeryville, CA
Posts: 1,412
Thanks: 0
Thanked 0 Times in 0 Posts
Will is on a distinguished road
Default Re: Coding Inquiry

Ummm... Fyron, I think you need to be introduced to the wonders of c_str().

code:
#include <string>
#include <fstream>
...
string aString;
...
ofstream outFile(aString.c_str()):
...

The c_str() method of string returns a pointer to a null-terminated array of char. Which is what the fstream classes take in their constructors.
__________________
GEEK CODE V.3.12: GCS/E d-- s: a-- C++ US+ P+ L++ E--- W+++ N+ !o? K- w-- !O M++ V? PS+ PE Y+ PGP t- 5++ X R !tv-- b+++ DI++ D+ G+ e+++ h !r*-- y?
SE4 CODE: A-- Se+++* GdY $?/++ Fr! C++* Css Sf Ai Au- M+ MpN S Ss- RV Pw- Fq-- Nd Rp+ G- Mm++ Bb@ Tcp- L+
Reply With Quote