Re: [Dev-C++] dynamic allocation and structs
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2002-10-25 10:59:41
|
On Fri, 25 Oct 2002, Carlos Garc=EDa del Monte wrote: > Some things about pasts messages, not very important. > The "or when exiting the scope", I wrote it, sorry, I was answering > other question, it was an error when clicking at th mail I wanted to > answer, now I don't remember which mail I was answering. >=20 > One of you said: > If array[0] is logical think there is array[1]. > That's right in programming, not in reality. > Reality: White House is whiteHousesArray[0]. But there is no a second > White House > If I say "I am the third son of my parents" you know there are the > second and the first sons, but you don't know if there is a fourth, or > we have to suppose there are a infinity? You can know previous, not the > following. > Programming: If there is not array[1], why bother writing array[0], when > you can say *array? Good. That was my point. My code used the a->x syntax, since there wasn't a a[1].x to access. In this case, the full expression became myarray[i]->x instead of myarray[i][0].x, since myarray was an array of pointers to single element, i.e. one-dimensional. >=20 > Although vector has the mathematical meaning of one dimensional array, > and we were talking about C, it would be better leave 'vector' for the > STL container, because that's our (or my) first thought when see > 'vector' here, so I read understanding one thing and in the middle of > the message, or some messages later, I notice I've misunderstood > everything, or simply I expected other thing. I was tempted to not read > this thread of messages, losing some interesting things. >=20 >=20 >=20 > ------------------------------------------------------- > This sf.net email is sponsored by: Influence the future=20 > of Java(TM) technology. Join the Java Community=20 > Process(SM) (JCP(SM)) program now.=20 > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >=20 |