473,508 Members | 2,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

multidimensional arrays

I was told not to use the low-level language such as arrays which
inherited from C, I want to know what can I use to substitute the
C-style multidimensional arrays? Is there multidimensional vector?

Sep 10 '06 #1
5 1968
asdf wrote:
I was told not to use the low-level language such as arrays which
inherited from C, I want to know what can I use to substitute the
C-style multidimensional arrays? Is there multidimensional vector?
E.g.,

std::vector< std::vector< int
Best

Kai-Uwe Bux
Sep 11 '06 #2

asdf 写道:
I was told not to use the low-level language such as arrays which
inherited from C, I want to know what can I use to substitute the
C-style multidimensional arrays? Is there multidimensional vector?
There are boost library
http://www.boost.org/libs/multi_arra...c_introduction

see if it fits your needs.

Sep 11 '06 #3
"asdf" <li*********@gmail.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
>I was told not to use the low-level language such as arrays which
inherited from C, I want to know what can I use to substitute the
C-style multidimensional arrays? Is there multidimensional vector?
The usually way is to do a vector of vectors, but I find that troublesome,
and usually wind up encapsulating the 2nd vector. Something like:

struct MyList
{
std::vector<intIntVector;
};

std::vector<MyListMy2DArray;

I just find the syntax a bit easier than
std::vector<std::vector<int My2DArray;
Sep 11 '06 #4

Jim Langston 写道:
"asdf" <li*********@gmail.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
I was told not to use the low-level language such as arrays which
inherited from C, I want to know what can I use to substitute the
C-style multidimensional arrays? Is there multidimensional vector?

The usually way is to do a vector of vectors, but I find that troublesome,
and usually wind up encapsulating the 2nd vector. Something like:

struct MyList
{
std::vector<intIntVector;
};
Why use a struct here, why not just do
typedef std::vector<intMyList;
std::vector<MyListMy2DArray;

I just find the syntax a bit easier than
std::vector<std::vector<int My2DArray;
Sep 11 '06 #5
asdf posted:
I was told not to use the low-level language such as arrays which
inherited from C, I want to know what can I use to substitute the
C-style multidimensional arrays? Is there multidimensional vector?

Long live inefficient code!

--

Frederick Gotham
Sep 11 '06 #6

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

Similar topics

2
1137
by: Terry | last post by:
Hi, can someone plz tell me how multidimensional arrays (like a 2-D array) are stored in memory? Are they like single dimensional arrays? Stored sequentially in one "row", so to say? Thanks ...
9
6653
by: Charles Banas | last post by:
i've got an interesting peice of code i'm maintaining, and i'd like to get some opinions and comments on it, hopefully so i can gain some sort of insight as to why this works. at the top of the...
3
2182
by: Ravi Singh (UCSD) | last post by:
Hello all I am trying to use jagged and multi-dimensional arrays in C++. In C# these work fine // for jagged arrays string jaggedArray = new string ; //for multidimensional arrays string...
21
4152
by: utab | last post by:
Hi there, Is there a way to convert a double value to a string. I know that there is fcvt() but I think this function is not a part of the standard library. I want sth from the standard if...
9
4473
by: Slain | last post by:
I need to convert a an array to a multidimensional one. Since I need to wrok with existing code, I need to modify a declaration which looks like this In the .h file int *x; in a initialize...
0
7123
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
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7383
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.