What's more important to know: "Big-O" scientology, or Assembly Language?

A

Alf P. Steinbach /Usenet

* James Kanze, on 25.08.2010 10:54:
James Kanze said:
there are no multidimensional arrays in C++, the closest
one can come is an array of arrays.
If "int array[10][20]" is not a multidimensional array, then
what is, in your opinion, a multidimensional array?
"int array[10][20]" is an array of 20 arrays of 10 int. It
behaves somewhat like a multidimensional array, but not
completely; something like:
int (*p)[10] = array;
wouldn't be legal if it were a multidimensional array.
Well, I didn't ask why "int array[10][20]" isn't
a multidimensional array (and, frankly, your argument wasn't
so convincing, IMO).

It wasn't "my argument". It's what the standard and the
language specification says.

No, it does not.

Please indicate which paragraph it is that you're misinterpreting, James.

C has multidimensional arrays. C++ does not lack them. Happily.


Cheers & hth.,

- Alf
 
A

Alf P. Steinbach /Usenet

* Alf P. Steinbach /Usenet, on 25.08.2010 11:50:
* James Kanze, on 25.08.2010 10:54:
there are no multidimensional arrays in C++, the closest
one can come is an array of arrays.
If "int array[10][20]" is not a multidimensional array, then
what is, in your opinion, a multidimensional array?
"int array[10][20]" is an array of 20 arrays of 10 int. It
behaves somewhat like a multidimensional array, but not
completely; something like:
int (*p)[10] = array;
wouldn't be legal if it were a multidimensional array.
Well, I didn't ask why "int array[10][20]" isn't
a multidimensional array (and, frankly, your argument wasn't
so convincing, IMO).

It wasn't "my argument". It's what the standard and the
language specification says.

No, it does not.

Please indicate which paragraph it is that you're misinterpreting, James.

C has multidimensional arrays. C++ does not lack them. Happily.

James, you might look at C++98 §8.3.4/2, <<When several "array" specifications
are adjacent, a multidimensional array is created, ...>>.


Cheers & hth.,

- Alf
 
R

red floyd

the meaning is: for some argument on programming
one has to know all first of speak
there is no "so-called"

I believe that the Standard does not refer to heap at all, but rather
"free store" and as for "stack", I believe it uses the term "automatic
storage", except when referring to stack unwinding. My copy of the
Standard
is dead tree, and I don't have enough time to search it right now, so
if
someone could confirm this, I'd be thrilled.

Therefore, yes, as I understand it, the heap and stack are "so-
called".
 
A

Alf P. Steinbach /Usenet

* red floyd, on 07.09.2010 22:55:
I believe that the Standard does not refer to heap at all, but rather
"free store" and as for "stack", I believe it uses the term "automatic
storage", except when referring to stack unwinding. My copy of the
Standard
is dead tree, and I don't have enough time to search it right now, so
if
someone could confirm this, I'd be thrilled.

Yes.

There is a little terminological problem here because in the context of storage
for automatic variables some use the word "stack" to denote a "machine stack", a
contiguous area of memory accessed as a stack, and in that sense C++ doesn't
require a stack for automatic variables: a "machine stack" is not required.

On the other hand, in the computer science meaning of stack as a LIFO structure,
C++ does require a stack for automatic variables, and it makes sense to talk
about "stack variables", "allocated on the stack" and so on.

Therefore, yes, as I understand it, the heap and stack are "so-
called".

Yes, but let's not forget about static storage... ;-)


Cheers,

- Alf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top