Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. C++ Vector Array in Template

C++ Vector Array in Template

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialc++graphicsdata-structures
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 11004573
    wrote on last edited by
    #1

    Hi! i am New Programmer of C++. please tell me how to Use Vector In Template With Return Type.Give Me Any Example With Detail Which Can Help Me In Understanding Of This Problem.

    L CPalliniC 2 Replies Last reply
    0
    • M Member 11004573

      Hi! i am New Programmer of C++. please tell me how to Use Vector In Template With Return Type.Give Me Any Example With Detail Which Can Help Me In Understanding Of This Problem.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Member 11004573 wrote:

      how to Use Vector In Template With Return Type.

      You need to be clearer about what you mean by this. There are many samples of vectors, templates and return types to be found on MSDN[^], CodeProject articles and through Google. However, if you have a specific coding issue then please show your code and expalin what errors you have.

      1 Reply Last reply
      0
      • M Member 11004573

        Hi! i am New Programmer of C++. please tell me how to Use Vector In Template With Return Type.Give Me Any Example With Detail Which Can Help Me In Understanding Of This Problem.

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        e.g.

        template <typename T> T find_max(const vector <T> & v)
        {
        //...
        }

        However, as pointed out by Richard, there are many, many possibilities, without further details cannot help more.

        THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite

        In testa che avete, signor di Ceprano?

        S 1 Reply Last reply
        0
        • CPalliniC CPallini

          e.g.

          template <typename T> T find_max(const vector <T> & v)
          {
          //...
          }

          However, as pointed out by Richard, there are many, many possibilities, without further details cannot help more.

          THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite

          S Offline
          S Offline
          Stefan_Lang
          wrote on last edited by
          #4

          I have to ask: why is it that Richard is leanings sideways in your response? Are you implying he's drunk? ;P

          GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)

          CPalliniC 1 Reply Last reply
          0
          • S Stefan_Lang

            I have to ask: why is it that Richard is leanings sideways in your response? Are you implying he's drunk? ;P

            GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)

            CPalliniC Offline
            CPalliniC Offline
            CPallini
            wrote on last edited by
            #5

            Yes, Stephan ;P

            THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite

            In testa che avete, signor di Ceprano?

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups