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. Beginner: How to declare pointers ?

Beginner: How to declare pointers ?

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++helptutoriallearning
2 Posts 2 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
    MirNixDirNix
    wrote on last edited by
    #1

    Hi, I am just starting to learn C(++) and therefore the following might be a silly question to you. But maybe your explanations will help me to understand some principles of C++: As far as I know pointers are declared like char *xyz (with the * bound to the beginning of the variable name). But in the C++/MFC-Help, pointers are mostly declared as CWnd* xyz (the * is following the type/class name). What is the difference? Thx a lot Christian Planckh

    P 1 Reply Last reply
    0
    • M MirNixDirNix

      Hi, I am just starting to learn C(++) and therefore the following might be a silly question to you. But maybe your explanations will help me to understand some principles of C++: As far as I know pointers are declared like char *xyz (with the * bound to the beginning of the variable name). But in the C++/MFC-Help, pointers are mostly declared as CWnd* xyz (the * is following the type/class name). What is the difference? Thx a lot Christian Planckh

      P Offline
      P Offline
      Phil Hamer
      wrote on last edited by
      #2

      There is no difference. It's just a matter of style. You can put as little or as much whitespace as you want. The following would all be OK: char*xyz; char *xyz; char* xyz; char * xyz;

      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