nested functions in VC++

Tech-Archive recommends: Speed Up your PC by fixing your registry



I think what I am looking for is a "nested function" which C++ doesn't
officially
support. Is the following workaround possible?


1. create a pointer to a function of type void fun ()
2. allocate memory for it
3. populate memory so newly created function does what I want
4. return pointer to said function

thx, -Alex

.



Relevant Pages

  • Re: C++ problem with a destructor
    ... add a private copy constructor and assignment operator and ... allocate memory to the pointer he. ... gethostbynamereturns a pointer to a struct of type hostent. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: How to return an array from a sub-routine.
    ... > I want to know how a subroutine should return an array of values to ... (Assumes function returns a pointer to a structure populated by ... sql_function use malloc to dynamically allocate memory and then make ... it the responsibility of the caller to free the memory when no longer ...
    (comp.lang.c)
  • Re: code critique wanted
    ... are elemental functions. ... the repetition of. ... You could have a pointer point to the array section to ... (as opposed to using them to allocate memory, ...
    (comp.lang.fortran)
  • Re: special memory allocator
    ... I need to allocate memory into a special place (pinned ... boundaries of my newly created fortran pointer, to permit me to make it ... Is it possible to force the lower bounds of my pointer to be 0? ... But using the bounds remapping feature, ...
    (comp.lang.fortran)
  • Re: Returning Char array/pointer? Continuing of thread I am confused with these concepts.
    ... function when I do the new char, it will allocate memory and change ... on the original pointer. ... reference, how does c++ know how many byte memory this pointer point ... But the compiler knows (at least for a non-POD type) because it knows how many destructors to call when you call delete. ...
    (microsoft.public.vc.language)