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. Visual Studio 6.0 bug

Visual Studio 6.0 bug

Scheduled Pinned Locked Moved C / C++ / MFC
csharpvisual-studiolinuxdata-structureshelp
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.
  • G Offline
    G Offline
    glowskull03
    wrote on last edited by
    #1

    i'm writing a header file and i have the following code: public: ... private: T arr[]; // when i compile it tells me that it is an illegal zero-sized array what i dont understand is that i works fine on a linux compiler, so what does zero-sized array mean alex

    A N 2 Replies Last reply
    0
    • G glowskull03

      i'm writing a header file and i have the following code: public: ... private: T arr[]; // when i compile it tells me that it is an illegal zero-sized array what i dont understand is that i works fine on a linux compiler, so what does zero-sized array mean alex

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      its not a bug.. you have to specify the size of an array or dynamically allocate it.. the size can't be unknown

      1 Reply Last reply
      0
      • G glowskull03

        i'm writing a header file and i have the following code: public: ... private: T arr[]; // when i compile it tells me that it is an illegal zero-sized array what i dont understand is that i works fine on a linux compiler, so what does zero-sized array mean alex

        N Offline
        N Offline
        ng kok chuan
        wrote on last edited by
        #3

        it isn't safe for linux to allow that actually. imo what vc++ did is correct. anyway if u want a zero-sized array, do u mean u're going to allocate memory to the array on the fly? if so, u should declare it as a pointer. i.e. T *ptr; then u should use new and delete to alloc and free the memory respectively. even better, use vectors as it does all the memory handling for u. http://www.roguewave.com/support/docs/sourcepro/stdlibref/vector.html[^]

        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