473,320 Members | 1,979 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

About Standard Template Library

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!!

Oct 23 '06 #1
8 1609
r3******@gmail.com 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.
Oct 23 '06 #2
"r3******@gmail.com" <r3******@gmail.comwrote:
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.
Oct 23 '06 #3

Daniel T. wrote:
"r3******@gmail.com" <r3******@gmail.comwrote:
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.

Oct 23 '06 #4
Daniel T. wrote:
"r3******@gmail.com" <r3******@gmail.comwrote:
>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
Oct 23 '06 #5
"Victor Bazarov" <v.********@comAcast.netwrote:
Daniel T. wrote:
"r3******@gmail.com" <r3******@gmail.comwrote:
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.
Oct 23 '06 #6
"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:
palindromeon 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."

Oct 23 '06 #7
On Mon, 23 Oct 2006 12:41:21 -0700, "osmium" <r1********@comcast.net>
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:
palindromeon 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
Oct 24 '06 #8
Zara wrote:
On Mon, 23 Oct 2006 12:41:21 -0700, "osmium" <r1********@comcast.net>
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: palindromeon 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
Oct 24 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Michael W. Hicks | last post by:
Hello, I'm looking to use a templated binary tree type structure that provides logorithmic insertion, retrieval and such. I'm familiar with the template<> class map in the standard library, and...
19
by: regisser | last post by:
I have a quastion for the C++ professionals and members of the C++ standartization commetee. As i know C++ standart requires an allocator to be a templated parameter in every STL container....
27
by: djake | last post by:
In the stroustrup C++ programming language (third edition) i can find example like this: string s1= "Hello"; So I imagine string is a standard class. Furthermore the class in the example is...
43
by: Steven T. Hatton | last post by:
Now that I have a better grasp of the scope and capabilities of the C++ Standard Library, I understand that products such as Qt actually provide much of the same functionality through their own...
6
by: sandwich_eater | last post by:
using g++ in cygwin... sv.cpp:13: warning: passing `double' for converting 1 of `int abs(int)' extract... #include <stdlib.h> #include <Math.h> double pythag(double a, double b)
3
by: Brian O'Haire | last post by:
Does C# have the equivalent of C++ standard template library? If so, can you point out where the documentation is located? Thanks Brian O'Haire
5
by: Kevin Carne | last post by:
First, Merry Christmas. I have been doing intensive Java programming for two years in school (no choice on the language), but now I need to return to C++ because my resume is filled with it both in...
36
by: utab | last post by:
Dear, I have experince in C( numerical projects, like engineering problems, scientific applications) I have the basic notion of C++ also, I have read Accelerated C++ until Chapter 7, however it...
8
by: sagi.perel | last post by:
I have tried to compile the following code on Win & Unix. Doesn't work on either. <----- CODE -----> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <vector> #include...
75
by: Steven T. Hatton | last post by:
No, this is not a troll, and I am not promoting Java, C-flat, D, APL, Bash, Mathematica, SML, or LISP. A college teacher recently posted to this newsgroup regarding her observation that there has...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.