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

Thread: Array

  1. #1
    Guest

    Array

    How can I assign a size to an array. For example. I want to read from a data file and count records, lines, or watever. Then I want to declare an array using that count.

    double Test[Counter]; // Counter being defined as: int Counter = 0;

    Then once I read the file and the counter now equals 113 how can I declare the above array? The compiler says I need a const value. How can I get around this? Is there a way I can typecast the int Counter? Thanks for your help.


  2. #2
    Guest

    Re: Array

    double * test = new double[count];


  3. #3
    Join Date
    May 1999
    Posts
    23

    Re: Array

    Just don't forget to:

    delete [] test;


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