Solved

setting the size of a matrix (array bound is not not an integer constant)

Posted on 2011-03-23
4
319 Views
Last Modified: 2012-05-11
Hello Experts,

I'm trying to make a matrix thats size depends on inputs from a file.

my code is something like:

int a,b,c;
int Matrix{a]{b]{c];  //i use normal brackets in the real code

then in the main I have it read from a file to get a,b,c and then go from there.

I am a novice C++ programmer.

Thank you.
0
Comment
Question by:NAB015
  • 3
4 Comments
 
LVL 32

Accepted Solution

by:
phoffric earned 250 total points
ID: 35202546
There are some good ideas here
    http://rdsrc.us/wVe3NA

and here
    http://rdsrc.us/yLHo3y

and here
    http://rdsrc.us/Ev4fF8
0
 

Author Closing Comment

by:NAB015
ID: 35202788
Thanks for pointing me in the right direction. An EE search might come after a google search before I post a question. Thanks.
0
 
LVL 32

Expert Comment

by:phoffric
ID: 35202827
When doing an EE search, first enter your keywords, then hit the advanced button and add a filter zone and choose C++ to reduce the number of hits.
0
 
LVL 32

Expert Comment

by:phoffric
ID: 35202844
If you have any questions when trying to implement this dynamic matrix (aka dynamic 2d array), don't hesitate to ask if you get stuck.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question