Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > About Standard Template Library

Reply
Thread Tools

About Standard Template Library

 
 
r3694117@gmail.com
Guest
Posts: n/a
 
      10-23-2006
i am a kookie in C++ ,and don't understand many things like following
example.

Write a function template palindrome that takes a vector parameter and
returns TRue or false according to whether the vector does or does not
read the same forward as backward .

can someone help me?thx!!

 
Reply With Quote
 
 
 
 
loufoque
Guest
Posts: n/a
 
      10-23-2006
wrote:

> Write a function template palindrome that takes a vector parameter and
> returns TRue or false according to whether the vector does or does not
> read the same forward as backward .


We don't do homework.
As this is trivial, the answer is probably in your book or lessons.
 
Reply With Quote
 
 
 
 
Daniel T.
Guest
Posts: n/a
 
      10-23-2006
"" <> wrote:

> i am a kookie in C++ ,and don't understand many things like following
> example.
>
> Write a function template palindrome that takes a vector parameter and
> returns TRue or false according to whether the vector does or does not
> read the same forward as backward .


Kind of an odd request. I would expect such a function to take a
basic_string, not a vector.

--
To send me email, put "sheltie" in the subject.
 
Reply With Quote
 
Noah Roberts
Guest
Posts: n/a
 
      10-23-2006

Daniel T. wrote:
> "" <> wrote:
>
> > i am a kookie in C++ ,and don't understand many things like following
> > example.
> >
> > Write a function template palindrome that takes a vector parameter and
> > returns TRue or false according to whether the vector does or does not
> > read the same forward as backward .

>
> Kind of an odd request. I would expect such a function to take a
> basic_string, not a vector.
>


Or two iterators.

 
Reply With Quote
 
Victor Bazarov
Guest
Posts: n/a
 
      10-23-2006
Daniel T. wrote:
> "" <> wrote:
>
>> i am a kookie in C++ ,and don't understand many things like following
>> example.
>>
>> Write a function template palindrome that takes a vector parameter
>> and returns TRue or false according to whether the vector does or
>> does not read the same forward as backward .

>
> Kind of an odd request. I would expect such a function to take a
> basic_string, not a vector.


I would probably expect it to take two iterators, which would make it
possible to be used with any standard containers, basic_string included.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


 
Reply With Quote
 
Daniel T.
Guest
Posts: n/a
 
      10-23-2006
"Victor Bazarov" <> wrote:
> Daniel T. wrote:
> > "" <> wrote:
> >
> >> i am a kookie in C++ ,and don't understand many things like following
> >> example.
> >>
> >> Write a function template palindrome that takes a vector parameter
> >> and returns TRue or false according to whether the vector does or
> >> does not read the same forward as backward .

> >
> > Kind of an odd request. I would expect such a function to take a
> > basic_string, not a vector.

>
> I would probably expect it to take two iterators, which would make it
> possible to be used with any standard containers, basic_string included.


Noah said the same thing. Two bi-directional iterators? That makes
sense; the string might contain more than one word and using iterators
would allow one to isolate each word.

--
To send me email, put "sheltie" in the subject.
 
Reply With Quote
 
osmium
Guest
Posts: n/a
 
      10-23-2006
"Daniel T." writes:

>> i am a kookie in C++ ,and don't understand many things like following
>> example.
>>
>> Write a function template palindrome that takes a vector parameter and
>> returns TRue or false according to whether the vector does or does not
>> read the same forward as backward .

>
> Kind of an odd request. I would expect such a function to take a
> basic_string, not a vector.


The first thing to do when confronted with some odd sounding request such as
this is to belabor the word defintions. From the first hit on <define:
palindrome> on google:

"A sequence that reads the same in either direction;
in genetics, refers to an enzyme recognition sequence
that reads the same on both strands of DNA."



 
Reply With Quote
 
Zara
Guest
Posts: n/a
 
      10-24-2006
On Mon, 23 Oct 2006 12:41:21 -0700, "osmium" <>
wrote:

>"Daniel T." writes:
>
>>> i am a kookie in C++ ,and don't understand many things like following
>>> example.
>>>
>>> Write a function template palindrome

<snip>
>
>The first thing to do when confronted with some odd sounding request such as
>this is to belabor the word defintions. From the first hit on <define:
>palindrome> on google:
>
> "A sequence that reads the same in either direction;
> in genetics, refers to an enzyme recognition sequence
> that reads the same on both strands of DNA."
>
>


Hey, what about "being a kookie"? Does it mean OP is sweet and edible?

Zara
 
Reply With Quote
 
Victor Bazarov
Guest
Posts: n/a
 
      10-24-2006
Zara wrote:
> On Mon, 23 Oct 2006 12:41:21 -0700, "osmium" <>
> wrote:
>
>> "Daniel T." writes:
>>
>>>> i am a kookie in C++ ,and don't understand many things like
>>>> following example.
>>>>
>>>> Write a function template palindrome

> <snip>
>>
>> The first thing to do when confronted with some odd sounding request
>> such as this is to belabor the word defintions. From the first hit
>> on <define: palindrome> on google:
>>
>> "A sequence that reads the same in either direction;
>> in genetics, refers to an enzyme recognition sequence
>> that reads the same on both strands of DNA."
>>
>>

>
> Hey, what about "being a kookie"? Does it mean OP is sweet and edible?


I think it's a variation of "a kook" and not of "a cookie".

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


 
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
Rum-Time Library vs Standard Library Carmen Sei C++ 4 03-05-2008 10:09 AM
add pexpect to the standard library, standard "install" mechanism. funkyj Python 5 01-20-2006 08:35 PM
How standard is the standard library? steve.leach Python 1 04-18-2005 04:07 PM
Re: Possible additions to the standard library? (WAS: Aboutstandard library improvement) Daniel Bickett Python 0 02-04-2005 11:22 AM
Re: Possible additions to the standard library? (WAS: Aboutstandard library improvement) Fredrik Lundh Python 0 02-04-2005 07:34 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57