CompuServe Thread

Forum unknown · Programming

#What's c++

5 messages in this thread
#131224From: John FoustJun 22, 1988 7:13 PM
Coming from more strongly typed languages, C's strings and pointers are a bit different. Not wrong or bad, just different. 🙂 If you say "char foo;", you get a character. If you say "char *foo;", you have something that can point to chars. If you have an "APTR foo;", if can point to anything, including characters. The only space allocated is for the size of the pointer itself. Saying "char foo[24];" allocates the space for you, just like dc.b. However, in C, 'foo' by itself can look like a pointer, because in most situations, the address of the first byte in that array is what you want, anyways, like "strcpy( foo, "bah" );" copies "bah" to foo[]. Saying 'char *foo = "bah"' is a different matter, you ask for storage for a char pointer, and then initialize the pointer to point at some static data, namely, "bah" and a zero byte. This all seems so clear to me. 🙂 Re: hopelessly bent. "**foo[*i,**j]" is easy. You can do better than that. That kind of construct is actually quite common on the Mac – be thankful that Amiga memory doesn't shift around a lot. Now, to make it hard, get some pointers to functions in there, that'll toughen it up.
#131350From: John DraperJun 23, 1988 2:48 AM
Confirmed: John is from a different planet than I am. 🙂 -larry
#131436From: Ben BlishJun 23, 1988 3:09 PM
We knew that, Larry. So…. when are you coming to Earth to visit John and I? Doesn't all that smog on planet modula bother you? Don't you get irritated every time you go thru a city-state border and customs type-checks your baggage? Ah well. I don't suppose you get a permit to external in any CASE:. Perhaps we'll link up in the future, if that's your Object. I guess, though, with such a long philosophical distance between us, it's not Wirth the effort. <waving in your general direction, which I figure to be about 10 degrees south of the plane of the ecliptic, referenced to the asteroid belt> –Ben–
#131436From: Ben BlishJun 23, 1988 3:09 PM
We knew that, Larry. So…. when are you coming to Earth to visit John and I? Doesn't all that smog on planet modula bother you? Don't you get irritated every time you go thru a city-state border and customs type-checks your baggage? Ah well. I don't suppose you get a permit to external in any CASE:. Perhaps we'll link up in the future, if that's your Object. I guess, though, with such a long philosophical distance between us, it's not Wirth the effort. <waving in your general direction, which I figure to be about 10 degrees south of the plane of the ecliptic, referenced to the asteroid belt> –Ben–
#131350From: John DraperJun 23, 1988 2:48 AM
Confirmed: John is from a different planet than I am. 🙂 -larry