Nov. 5th, 2005
C/C++ issues
Nov. 5th, 2005 03:28 pmThe code I'm trying to port (UNIX->Windows) is an extreme fan of this convention:
( code within )
Visual Studio flips out and cries when this happens; the very same code compiled happily in GCC under Cygwin. I saw something somewhere that declaring functions inside other functions is strictly forbidden in C; is this true? Does GCC waive this little restriction? Is there anything else I can do about this than make the function and the variable global? I suppose I could make a struct that has those variables within it, add that as an argument to otherfunction and everything else that's ever aware of it, but that sounds like a royal pain. Is there a setting somewhere that makes this possible again?
click
( code within )
Visual Studio flips out and cries when this happens; the very same code compiled happily in GCC under Cygwin. I saw something somewhere that declaring functions inside other functions is strictly forbidden in C; is this true? Does GCC waive this little restriction? Is there anything else I can do about this than make the function and the variable global? I suppose I could make a struct that has those variables within it, add that as an argument to otherfunction and everything else that's ever aware of it, but that sounds like a royal pain. Is there a setting somewhere that makes this possible again?
click
Meme from
sphaelar.
If you read this, if your eyes are passing over this right now, even if we don't speak often, please post a comment with a memory of you and me. It can be anything you want, either good or bad.
When you're finished, post these instructions on your blog and be surprised (or mortified) about what people remember about you.
click
![[livejournal.com profile]](https://www.dreamwidth.org/img/external/lj-userinfo.gif)
If you read this, if your eyes are passing over this right now, even if we don't speak often, please post a comment with a memory of you and me. It can be anything you want, either good or bad.
When you're finished, post these instructions on your blog and be surprised (or mortified) about what people remember about you.
click