Re: Passing on ostringstream
On 2008-07-19 11:34, vsuresh.cs@gmail.com wrote:
Then how do you expect people to help?
Hi Ian,
my subject is "passing on ostringstream" and its not related to cin/
cout or syntax error.
But none of your problems or questions were about passing an ostringstream.
But people are pointing to the syntax error and
other optimizations that can be done on my program.
I have not seen any advice about optimisations, but I have seen (and
given) some about good design and writing good code. While it is
possible to write error-free code in a bad way, it is much easier to
reduce the errors if the code quality is high.
As i am new to
this group, i dont know that i want to write 100% error free code :
( will writing sample pgms.
Since you are new to C++ and it is a complex language it might be hard
for you to figure out what the errors are, and (again since it is a
complex language) it might be hard for us too if we can not see all the
code. We do not require you to post 100% error free code, but we will
point out the errors we find, in fact we do not even require that you
post compiling code in some instances, but we do want you to post the
actual code you are having problems with.
In simple words, is it advisable to pass ostringstream as a char* to
another interface ?
No.
Can i know the reason why its not advisable ?
It is never advisable to us char* when you want strings unless you
really have to, use std::string instead whenever possible. Especially as
in your case what you really want is a string (since that is what you
have in you map) and not a char*.
--
Erik Wikstr??m