473,666 Members | 2,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

multidimensiona l 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 multidimensiona l arrays? Is there multidimensiona l vector?

Sep 10 '06 #1
5 1980
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 multidimensiona l arrays? Is there multidimensiona l 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 multidimensiona l arrays? Is there multidimensiona l 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*********@gm ail.comwrote in message
news:11******** **************@ p79g2000cwp.goo glegroups.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 multidimensiona l arrays? Is there multidimensiona l 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<int IntVector;
};

std::vector<MyL istMy2DArray;

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

Jim Langston 写道:
"asdf" <li*********@gm ail.comwrote in message
news:11******** **************@ p79g2000cwp.goo glegroups.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 multidimensiona l arrays? Is there multidimensiona l 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<int IntVector;
};
Why use a struct here, why not just do
typedef std::vector<int MyList;
std::vector<MyL istMy2DArray;

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 multidimensiona l arrays? Is there multidimensiona l 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 Terry
9
6665
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 function (which was translated from Fortran code), among other heinous and numerous declarations, is this bit: static float bbuff; static int bkey; static int buse;
3
2193
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 multidimensionalArray = new string
21
4173
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 possible. The thing I am trying to do is to convert a double value to a string with 8 elements. 8 is fixed because of the files I work with. I will change this 8 character string with the one(8 character string) already in the file and so on. But I...
9
4494
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 function: x = new int;
0
8444
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8551
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8639
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5664
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2771
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1775
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.