John Summerfield wrote:
> 
> > John Summerfield wrote:
> > >
> > > I have a code fragment:
> > >                 struct group *grp = getgrnam(group.data());
> >
> > you have to use group.c_str() since .data() doesn't have a \0 terminator.
> 
> Filled with disbelief ( the C++ primer DOES use the word "string"), I tried it.

A "string" is not necessarily a "C-string"
The use of [begin,end) instead of [begin,end]
tells you it doesn't include the last character
(the NULL that terminates a "C-string").

I remember seeing it in some math classes, but
not in a programing book.

        -Thomas



_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-devel-list

Reply via email to