Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-03-23
4
Medium Priority
?
349 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 32

Accepted Solution

by:
phoffric earned 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

660 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