About Standard Template Library

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • r3694117@gmail.com

    #1

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

  • loufoque

    #2
    Re: About Standard Template Library

    r3694117@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.

    Comment

    • Daniel T.

      #3
      Re: About Standard Template Library

      "r3694117@gmail .com" <r3694117@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.

      Comment

      • Noah Roberts

        #4
        Re: About Standard Template Library


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

        Comment

        • Victor Bazarov

          #5
          Re: About Standard Template Library

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


          Comment

          • Daniel T.

            #6
            Re: About Standard Template Library

            "Victor Bazarov" <v.Abazarov@com Acast.netwrote:
            Daniel T. wrote:
            "r3694117@gmail .com" <r3694117@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.

            Comment

            • osmium

              #7
              Re: About Standard Template Library

              "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."



              Comment

              • Zara

                #8
                Re: About Standard Template Library

                On Mon, 23 Oct 2006 12:41:21 -0700, "osmium" <r124c4u102@com cast.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

                Comment

                • Victor Bazarov

                  #9
                  Re: About Standard Template Library

                  Zara wrote:
                  On Mon, 23 Oct 2006 12:41:21 -0700, "osmium" <r124c4u102@com cast.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


                  Comment

                  Working...