TIP: Click on subject to list as thread! ANSI
echo: nthelp
to: Geo
from: Paul Ranson
date: 2004-10-19 12:18:20
subject: Re: Organizing source code

From: "Paul Ranson" 

'C' and 'C++' intrinsically only handle strings as character arrays followed
by a null terminator. This is only really relevant to string literals. The
C++ library contains a string implementation, this is part of C++ but not
intrinsic. There are many third party alternatives. These strings are not
necessarily null terminated.

BTW your instructor is way out of date. This is worrying. Nobody should be
going anywhere near 'iostream.h' unless they have a really good reason, and
you don't.

C++ strings (std::string) have a set of 'find' member functions for finding
characters, sub strings, etc. (actually rather a bad design for a number of
reasons...) Anyway if you can eventually persuade the network to pass you
every packet you aren't going to have 'strings' you're going to have
buffers. And you'll need a more generic way of searching them. There's a
function in the C++ library called 'search' that can do what you want to
any buffer or container.

Paul

"Geo"  wrote in message news:417466bc{at}w3.nls.net...
> "Gregg N"  wrote in message
> news:4173e605$1{at}w3.nls.net...
>
>> Which .h files?
>
> umm.. all the ones I didn't write (like math.h)?
>
>
>> C++ does strings.
>
> Well I'm certainly no expert considering I've only started taking this
> class
> but as I understand it a C++ string is actually a character array, like
> "char bob[]" instead of an actual string like
"bob$". I know they are
> similar as I already wrote a bubblesort routine but the teacher made a
> point
> to me that it's not a text string like in other languages, that there is
> some significant difference although she didn't explain it any further
> than
> that yet.
>
>> Are you asking how do I find documentation for such a class? From
>> experience, I know what is generally available as part of the standard
>> library. When I need to look something up, I usually use the
>> documentation
>> that comes with whatever tool I am using. For Visual C++, I use either
> MSDN
>> (locally),
>
> OK now go easy on me. Basically we've used 3 libs in class, ,
>  and  so I'm sitting here wondering
where these come
> from
> and how I find out what other ones are available in the standard visual
> studio install and how I find out what functions they provide. If I'm
> understanding you and Antti, that information is contained in MSDN so I
> need
> to install that on my laptop along with the visual c++ I've already
> installed? Ok that's easy.
>
> But to use my example, suppose I'm looking for a function to find a string
> within a string (knowing they aren't strings) how the heck do you go about
> finding the function if it exists? Isn't there a list of some sort
> somewhere
> for the basic set that appears to be included?
>
> Geo.
>
>

--- BBBS/NT v4.01 Flag-5
* Origin: Barktopia BBS Site http://HarborWebs.com:8081 (1:379/45)
SEEN-BY: 633/267 270 5030/786
@PATH: 379/45 1 396/45 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.