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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Pointers

Pointers

Scheduled Pinned Locked Moved C / C++ / MFC
tutoriallearning
3 Posts 3 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.
  • B Offline
    B Offline
    bhangie
    wrote on last edited by
    #1

    Hi I would like to know why do we realy need pointers is it posible to write a program without the use of pointers. Explain the free store and the heap MyAp *YourAp = new MyAp; is this accessing the free store An example would be nice thanks Kind of a beginner. thanks in advance.

    P T 2 Replies Last reply
    0
    • B bhangie

      Hi I would like to know why do we realy need pointers is it posible to write a program without the use of pointers. Explain the free store and the heap MyAp *YourAp = new MyAp; is this accessing the free store An example would be nice thanks Kind of a beginner. thanks in advance.

      P Offline
      P Offline
      Prakash Nadar
      wrote on last edited by
      #2

      Its no use explaning about pointers like this in the forum, what you should really do is get a book on pointers and understand the concept and different things related to that like referencing and how it is used with function arguments etc.. sure i can anwer this question but i bet its going to only solve one question from 100s regarding pointers. so no point do it.


      I have lost more blood shaving than on the battlefield - Adolf Hitler

      1 Reply Last reply
      0
      • B bhangie

        Hi I would like to know why do we realy need pointers is it posible to write a program without the use of pointers. Explain the free store and the heap MyAp *YourAp = new MyAp; is this accessing the free store An example would be nice thanks Kind of a beginner. thanks in advance.

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        hi man, in fact, we uns pointers for many reasons. First, in C++, the existence of the pointers comes from the compatibility with the C, in which references don't exist. We also use pointers instead of value copies in function calls because it become heavy and "memory hungry" if we transfer some big data structures... for that reason, we also have the const keyword to avoid writing on pointed datas. The last reason i see wee use pointers for, it is because sometimes, we don't use variable names to refer to datas (tables, vectors, queues...). We so don't have other way to manipulate these addresses that with pointers... TOXCCT alias Nicolas C.

        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