472,807 Members | 3,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 1930
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
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
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
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
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
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.