Re: saving DBs


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]

Posted by Matt Green on April 01, 2001 at 13:05:17:

In Reply to: saving DBs posted by Marcus O Obusan on April 01, 2001 at 13:01:46:

: im having errors saving my DBs to a file.
: Im takin in the filename......and opening ofstream x(filename)....Im gettin this error.....

: : cannot convert parameter 1 from 'class std::basic_string,class std::allocator >' to 'const char *'

: but filename is a string??........any help is appreciated
Its a string, yes, ofstream expects a ptr to a sequence of characters (C-style strings), not the newer type. Just use filename.c_str() to convert it and you'll be fine.

GL,
Matt



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]