CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Jul 2009
    Posts
    4

    Why not dynamic char array sizing

    Just wondering about creating a dynamic string array

    int i = this->txtMain->Text->Length - 1;
    char x[i];

    This gives me 3 errors

    Error 1 error C2057: expected constant expression
    Error 2 error C2466: cannot allocate an array of constant size 0
    Error 3 error C2133: 'x' : unknown size

    Can someone explain to me why. Im a n00b

    Thanks
    Last edited by thomas49th; August 2nd, 2009 at 02:48 PM. Reason: change title

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured