Solved

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

Posted on 2011-03-23
4
326 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C language IDE – Compilers installation 14 75
object oriented programming on screen browser tutorial lesson 2 82
Best book to learn C++ 4 85
C++ Code Issue 4 26
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

808 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