Hi,
Sorry to ask this question in such a backward way, but in java it is
possible to say
int[][] arr = new int[][] { { 1 }, { 1, 2}, { 1, 2, 3}};
Is it possible to do the same in C++ with an (int **)? (Understanding,
of course, that I will need to know the sizes of arrays when using
arr.)
Thanks,
Aaron Fude 1 1234 aa*******@gmail.com wrote: Sorry to ask this question in such a backward way, but in java it is possible to say
int[][] arr = new int[][] { { 1 }, { 1, 2}, { 1, 2, 3}};
Is it possible to do the same in C++ with an (int **)? (Understanding, of course, that I will need to know the sizes of arrays when using arr.)
In C++ I'd recommend using std::vector :
std::vector<std::vector<int> > arr;
Although, initialisation of it is not a simple thing, especially since
its elements have different sizes.
V This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Christopher T King |
last post by:
Okay, so this is really two requests in one, and they're both kinda
outlandish, but I'm gonna post them nonetheless:
I've always thought xrange() to be ugly; it looks to be a lot of typing
just...
|
by: F Jamitzky |
last post by:
It is rather easy to define functions in python that mimic the special
ruby syntactic sugar like:
5.times { print "Hello World!" }
or
.each { |food| eat food }
In python these fragments...
|
by: Bangalore |
last post by:
Hi all,
Plz clarify me, on the implementation of two or three dimensional
array using overloaded operator.
Thanks, in advance
Bangalore
|
by: Bob Stearns |
last post by:
This is probably the wrong forum for this, but I thought it might start
some discussion.
The INSERT statement, in its current form, has problems being formatted
so a human reader can follow it....
|
by: Neil Zanella |
last post by:
Hello,
It seems to me that C# properties are nothing more than syntactic sugar for
getters and setters. I wonder whether others hold a different point of view.
Basically, what more do they have...
|
by: Bas |
last post by:
Hi group,
just out of curiosity, is there a list of all the syntactic sugar that
is used in python? If there isn't such a list, could it be put on a
wiki somewhere? The bit of sugar that I do...
|
by: glomde |
last post by:
i I would like to extend python so that you could create hiercical
tree structures (XML, HTML etc) easier and that resulting code would be
more readable than how you write today with packages like...
|
by: Sam Kong |
last post by:
Hi,
While discussing C#'s using statement, a guy and I had an argument.
In C# spec (15.13), there's an explanation like the following.
using (R r1 = new R()) {
r1.F();
}
is precisely...
|
by: Helmut Jarausch |
last post by:
Hi,
are decorators more than just syntactic sugar in python 2.x and what
about python 3k ?
How can I find out the predefined decorators?
Many thanks for your help,
Helmut Jarausch
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
| |