473,395 Members | 1,471 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Dynamic Matrix

If I want to create a dynamic array I may use this:

int size;
cin >> size;

int *nameArray;
nameArray = new int[size];

Is there a way to create a dynamic matrix?

Oct 31 '05 #1
2 10546
Gaijinco wrote:
If I want to create a dynamic array I may use this:

int size;
cin >> size;

int *nameArray;
nameArray = new int[size];

Is there a way to create a dynamic matrix?


This is in the FAQ
http://www.parashift.com/c++-faq-lit...tore-mgmt.html

You particularly want 16.16 through to 16.19

Gavin Deane

Oct 31 '05 #2
Gaijinco wrote:
If I want to create a dynamic array I may use this:

int size;
cin >> size;

int *nameArray;
nameArray = new int[size];

Is there a way to create a dynamic matrix?


Yes. Read the FAQ.

V
Oct 31 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: E G | last post by:
Hi, I have a class similar to this: class Matrix { private: float **_A; unsigned _rows,_cols; public:
6
by: fivelitermustang | last post by:
I have two matrices allocated dynamically in both directions: matrix x and matrix v. I want to pass these matrices into a function by reference. What I have written down isn't working... can...
11
by: fivelitermustang | last post by:
Actually, how would I go about allocating a four-dimensional dynamic array? I only know how to make two dimensional dynamic arrays: double **v; v = new double*; for (int i=0; i<C; i++) { v =...
4
by: Leslaw Bieniasz | last post by:
Cracow, 20.10.2004 Hello, As far as I understand, the generic programming basically consists in using templates for achieving a static polymorphism of the various code fragments, and their...
16
by: laclac01 | last post by:
I have developed my own copy function for coping my own dynamic memory structure. It works, but I feel its not too efficient. There must be a quicker way to copy the data. In some of the...
3
by: paytam | last post by:
Hi all How can I define a dynamic matrix and pass it to a function?
60
by: Peter Olcott | last post by:
I need to know how to get the solution mentioned below to work. The solution is from gbayles Jan 29 2001, 12:50 pm, link is provided below: >...
3
by: repairman2003 | last post by:
I'm having some trouble with poitners and dynamic arrays (a matrix). Given this function I have a few questions. void func(int* mat, int rows, int columns, char* out) { ... }
1
by: Peterwkc | last post by:
Hello all expert, i have two program which make me desperate bu after i have noticed the forum, my future is become brightness back. By the way, my problem is like this i the first program was...
1
by: crimsonalucard | last post by:
Below is a function I wrote used to evaluate the determinant of a nxn matrix. arguments are an array of the matrix values in order going from left to right jumping to the next line then going from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.