Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Feeding string into ostringstream only uses up to the first null?

Reply
Thread Tools

Feeding string into ostringstream only uses up to the first null?

 
 
Jerry Coffin
Guest
Posts: n/a
 
      06-01-2008
In article <92c2000e-b812-43e1-8806-8cd3e4266371
@x41g2000hsb.googlegroups.com>, http://www.velocityreviews.com/forums/(E-Mail Removed) says...

[ ... ]

> > This is one place Ada did things right, IMO. Most languages
> > have arrays and strings that have special capabilities. For
> > Ada they just designed enough capabilities into arrays to
> > allow an array of characters to be a usable string.

>
> You mean you can to things like case indifferent comparisons
> (locale dependent, of course) on an array in Ada?


Yes, I believe so. My experience was (mostly) with Ada 83, which had the
right capabilities for its arrays that you could do this, but you had to
write all the actual locales and such yourself.

If I'm not mistaken, Ada 95 added a fairly reasonable character handling
package to handle things like case conversion on a locale-dependent
basis.

Doing a bit of looking confirms that there is, in fact, an
ada.characters.handling package. Glancing it over, it looks like it's at
least on the same general order of capabilities as those in C++, though
I don't see any immediate indication that it's drastically better.

> This doesn't mean that I think that Ada did the wrong thing.
> I'm not sure we know enough, even today, to be able to
> reasonably specify what a class representing text strings should
> look like. And at least the Ada solution is honest, and doesn't
> pretend to offer something it doesn't, nor does it commit the
> language to something that is likely to turn out wrong in the
> long run.


Right -- my point wasn't that Ada has anything beyond the state of the
art elsewhere, only that its arrays provide most of the capabilities to
do string handling that's on a par with most other languages.

[ ... ]

> And all of the Microsoft IDE's lose a great deal of productivity
> when compared to a real development system (with powerful
> scripting languages to automate a lot of the tasks).


Microsoft's IDEs allow you to write scripts in a variant of Visual Basic
that seems to be adequate for most tasks. If you really want to, you can
also write code in C, C++, etc., as a plug in.

If there's another environment that really provides greater
productivity, I'd love to know about it -- but so far, nothing else
anybody's suggested has worked out particularly well for me.

--
Later,
Jerry.

The universe is a figment of its own imagination.
 
Reply With Quote
 
 
 
 
James Kanze
Guest
Posts: n/a
 
      06-01-2008
On Jun 1, 5:27 pm, Jerry Coffin <(E-Mail Removed)> wrote:
> [ ... ]


> > And all of the Microsoft IDE's lose a great deal of productivity
> > when compared to a real development system (with powerful
> > scripting languages to automate a lot of the tasks).


> Microsoft's IDEs allow you to write scripts in a variant of
> Visual Basic that seems to be adequate for most tasks.


But not for running them on a Sparc under Solaris.
(Seriously, I suspect that that would answer most objections.
Except the portability one, of course.

> If you really want to, you can also write code in C, C++,
> etc., as a plug in.


> If there's another environment that really provides greater
> productivity, I'd love to know about it -- but so far, nothing
> else anybody's suggested has worked out particularly well for
> me.


Well, the best environment is generally the one you know best.
I certainly wouldn't be as productive with Microsoft's IDE as I
am with my Unix based toolkit---at least until I got to know it
as well.

(Another real problem in my case is age. Learning a new
editor---to the point where it is your fingers which do the
thinking---is about like learning a musical instrument, and at
60, it's a lot harder than at 20.)

--
James Kanze (GABI Software) email:(E-Mail Removed)
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
 
Reply With Quote
 
 
 
 
Jerry Coffin
Guest
Posts: n/a
 
      06-02-2008
In article <cd8beb5e-0f7e-47f4-9930-c28d5d58890f@
59g2000hsb.googlegroups.com>, (E-Mail Removed) says...
> On Jun 1, 5:27 pm, Jerry Coffin <(E-Mail Removed)> wrote:


[ ... ]

> > Microsoft's IDEs allow you to write scripts in a variant of
> > Visual Basic that seems to be adequate for most tasks.

>
> But not for running them on a Sparc under Solaris.
> (Seriously, I suspect that that would answer most objections.
> Except the portability one, of course.


Yup -- no question that it's not portable. At the same time, if somebody
really wanted it on Unix, I can't see where it'd really be substantially
more difficult than a lot of other things to duplicate. OTOH, much of
what it does is more or less Windows-specific in any case -- X doesn't
really have/support a direct analog of a Windows message handler, so if
you supported development for Unix, you'd nearly have to make some
fairly substantial changes in how things work in any case.

[ ... ]

> Well, the best environment is generally the one you know best.
> I certainly wouldn't be as productive with Microsoft's IDE as I
> am with my Unix based toolkit---at least until I got to know it
> as well.
>
> (Another real problem in my case is age. Learning a new
> editor---to the point where it is your fingers which do the
> thinking---is about like learning a musical instrument, and at
> 60, it's a lot harder than at 20.)


No doubt about that -- I'm only in my 40's, but I already find it harder
to learn some new things than I used to (especially, as you point out,
some things that involve muscle memory).

--
Later,
Jerry.

The universe is a figment of its own imagination.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
string vs. ostringstream schoedl@gmail.com C++ 2 01-17-2008 09:46 AM
Feeding data into MySQLdb LOAD DATA from Python John Nagle Python 2 11-15-2007 07:57 AM
std::string and std::ostringstream performances Bala2508 C++ 28 11-03-2007 03:22 AM
returning a string from an ostringstream Thomas Lenz C++ 7 10-23-2007 06:52 PM
beginner question: feeding a query string into an Xpath expression xerj ASP .Net 2 05-08-2006 01:17 PM



Advertisments