Freethought & Rationalism ArchiveThe archives are read only. |
07-11-2003, 06:05 PM | #71 | |
Veteran Member
Join Date: Jan 2001
Location: USA
Posts: 1,072
|
Quote:
|
|
07-11-2003, 06:20 PM | #72 | ||
Veteran Member
Join Date: Jan 2001
Location: USA
Posts: 1,072
|
Re: possible
Quote:
Quote:
The bits (and bytes) that store data are not contiguous even in physical memory. They are not actually touching each other...there is intervening space, and so they are not physically connected together to form an unbroken chain. Of course, taking contiguous to that level makes the term worthless in regard to the discussion...just as your use of the word contiguous does. PS: Sorry if I am talking over your head. |
||
07-11-2003, 06:33 PM | #73 | ||
Veteran Member
Join Date: Jan 2001
Location: USA
Posts: 1,072
|
Quote:
If what you said were true, that it's the compiler alone and not the computer, then I could take my C++ code with the two-dimensional array declaration and lay it on my C++ compiler CD and the compiler would resolve the array references. Here, let me try....Nope, didn't work for some reason. I wonder why? Oh, that's right. Because you MUST have a computer to do that for you. Quote:
That really confuses you? Sorry. |
||
07-11-2003, 06:51 PM | #74 | |
Veteran Member
Join Date: Jan 2001
Location: USA
Posts: 1,072
|
Quote:
|
|
07-11-2003, 07:34 PM | #75 | |
Veteran Member
Join Date: Jan 2001
Location: USA
Posts: 1,072
|
Quote:
I can write different programs all day long that consistently "refute" you but all that shows is that the particular compiler I use allocates memory for multi-dimensional arrays the "right" way. There is nothing in the language specifications that mandates compiler XYZ to do it the same way, so my results are not universal...they only appear to successfully counter you. Also, I do remember reading that a two-dimensional array is an array of arrays, but I misremembered it as being mostly for conceptualizing more "complex" arrays (multi-dimensional arrays containing char pointers, or pointers to pointers, for example) and not for an array containing single primitive data types as elements. Your logic eventually won me over. What really convinces is your last discussion about possibly padding individual rows of a two-dimensional array in order to align them on particular byte boundaries. I can see why the language specifications would allow for that possibility. |
|
07-11-2003, 08:23 PM | #76 |
Veteran Member
Join Date: Jan 2001
Location: Median strip of DC beltway
Posts: 1,888
|
Glad you see my point.
Resisting temptation to explain memory mapping now... |
07-11-2003, 10:13 PM | #77 |
Regular Member
Join Date: Mar 2002
Location: Nacogdoches, Texas
Posts: 260
|
I'd just like to know what DNAUnion thinks he's accomplishing here. If he's posting here in order to learn something, then he's not listening to the responses. If he's trying to demonstrate that he's a competent programmer, he's failing at that too.
JMO. |
07-11-2003, 10:22 PM | #78 | |
Senior Member
Join Date: Feb 2003
Location: San Diego, California
Posts: 719
|
Quote:
|
|
07-12-2003, 07:05 AM | #79 |
Veteran Member
Join Date: May 2003
Location: On the road to extinction. . .
Posts: 1,485
|
Now I remember why they invented C++, and strong type checking in languages like Java.
Well, DNAunion, I concede the points to you again. Possibly because I do not have any other choice. I hope you learned a few good pointers from an aging professional. I cannot claim the same, even though I wished to improve my lot when I saw the title of the thread. I did'nt know we were supposed to debug your coding. Sincere apologies emanate from these quarters. The science you speak of is egotism, which places you in a class all by yourself. Thusly you should request a title change of the thread to read "The egotism of computer coding". Again, I bow to a superior encoding. |
07-12-2003, 07:39 AM | #80 |
Veteran Member
Join Date: May 2003
Location: On the road to extinction. . .
Posts: 1,485
|
one last shot
DNAunion: And they are misleading (as I used the term) when they indicate that elements are stored in a two-dimensional row/col table in memory, when they are actually stored linearly and contiguously. That really confuses you? Sorry.
What is misleading about that Sir? If you think this is misleading, then you have a career ahead of you where you will be mislead all your career. There is the meta-representation aspect you fail to acknowledge. The point you fail to grasp is "elements in a two-dimensional array are used as if they are in a table", the teachers exchange terms, usage of the element with storage of the element so those new to the science do not have to encounter the meta-representative at first shot. I REPEAT, using a two dimensional array is interchangeable with storing information in a two dimensional array. You don't teach so you have no clue about this. Secondly, when pointer arithmitic, is used past one dimensional arrays, as you have since agreed with Nial, obtaining the base address of each dimension, &foo(i,0) is recommended practice rather than calculating the offset from the zero dimension, &foo(0,0). The reason being, as you agreed with Nial, pointer arithmitic is not guarenteed to be true, crossing dimensions. |
Thread Tools | Search this Thread |
|