D - Possible Error in Comparison Checklist
- NobodyImportant (4/4) Oct 16 2003 I could be wrong, but I'm pretty sure that C++, and probably C as well, ...
- Matthew Wilson (26/30) Oct 16 2003 Well, first, neither C or C++ support nested functions.
- Andy Friesen (4/9) Oct 16 2003 I used this several times way back in my DJGPP days without even
- Walter (6/15) Oct 17 2003 much
I could be wrong, but I'm pretty sure that C++, and probably C as well, supports nested functions. This may or may not be ANSI, but I'm almost positive that g++ supports it. Perhaps you should look into that, or at least offer some sort of clarification a la the resizable arrays for C++.
Oct 16 2003
Well, first, neither C or C++ support nested functions. Whether GCC does, I've never heard of it (not that that means terribly much ;)) I've just tried the following: #include <stdio.h> int main() { int add(int i) { return 1 + i; } int i = add(10); printf("%d => %d\n", 10, i); return 0; } and it does not work with GCC 3.2. Is this the kind of thing you're talking about? Are there compiler flags I should be using? btw, D's nested functions carry with them the context of their enclosing scope, so that variables in that scope are accessible in the nested function. Is that the case with GCC? It'd be very interesting if so. Matthew "NobodyImportant" <NobodyImportant_member pathlink.com> wrote in message news:bmn558$1kkp$1 digitaldaemon.com...I could be wrong, but I'm pretty sure that C++, and probably C as well,supportsnested functions. This may or may not be ANSI, but I'm almost positivethat g++supports it. Perhaps you should look into that, or at least offer somesort ofclarification a la the resizable arrays for C++.
Oct 16 2003
Matthew Wilson wrote:Well, first, neither C or C++ support nested functions. Whether GCC does, I've never heard of it (not that that means terribly much ;))I used this several times way back in my DJGPP days without even realizing it. I don't know if newer versions of GCC support it, but the really old ones apparently do.
Oct 16 2003
"Andy Friesen" <andy ikagames.com> wrote in message news:bmndp6$1vui$1 digitaldaemon.com...Matthew Wilson wrote:muchWell, first, neither C or C++ support nested functions. Whether GCC does, I've never heard of it (not that that means terriblyGCC apparently does support nested functions, but G++ does not. In any case, it is not part of standard C nor C++, and no other C/C++ compiler I know of supports it.;))I used this several times way back in my DJGPP days without even realizing it. I don't know if newer versions of GCC support it, but the really old ones apparently do.
Oct 17 2003