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. Managed C++/CLI
  4. Using typedef with an array

Using typedef with an array

Scheduled Pinned Locked Moved Managed C++/CLI
helpdata-structurestutorialquestion
4 Posts 4 Posters 1 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.
  • V Offline
    V Offline
    vnngoc156
    wrote on last edited by
    #1

    My problem is: when i define like this typedef float Sequence[]; i dont know how to declare an array with Sequence. Ex:if i declare Sequence a[10]; it doesn't work. Can you help me??? Thank in anticipation!!!

    C R P 3 Replies Last reply
    0
    • V vnngoc156

      My problem is: when i define like this typedef float Sequence[]; i dont know how to declare an array with Sequence. Ex:if i declare Sequence a[10]; it doesn't work. Can you help me??? Thank in anticipation!!!

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I doubt that you can. Why would you do this ? Why obsfucate your code with not just typedefs, but a typedef that hides the fact that you're dealing with an array ? Christian Graus - Microsoft MVP - C++

      1 Reply Last reply
      0
      • V vnngoc156

        My problem is: when i define like this typedef float Sequence[]; i dont know how to declare an array with Sequence. Ex:if i declare Sequence a[10]; it doesn't work. Can you help me??? Thank in anticipation!!!

        R Offline
        R Offline
        RichardS
        wrote on last edited by
        #3

        Hi, Typedefs are like fancy text replacements, so you just coded: float a[10][] Hence the compiler does not know what the second index is. You are creating a double pointer list. regards, Rich "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far the Universe is winning." -- Rich Cook

        1 Reply Last reply
        0
        • V vnngoc156

          My problem is: when i define like this typedef float Sequence[]; i dont know how to declare an array with Sequence. Ex:if i declare Sequence a[10]; it doesn't work. Can you help me??? Thank in anticipation!!!

          P Offline
          P Offline
          Prabhu977
          wrote on last edited by
          #4

          use: typedef float Sequence; Sequence a[10]; Bye and c ya!

          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