POV-Ray : Newsgroups : povray.off-topic : Smart little programming tricks, where to find ? : Re: Smart little programming tricks, where to find ? Server Time
10 Oct 2024 23:19:13 EDT (-0400)
  Re: Smart little programming tricks, where to find ?  
From: Mike Raiford
Date: 19 Mar 2008 06:58:13
Message: <47e0ffd5$1@news.povray.org>
Invisible wrote:

> And that's the sad part. C is a horrid, horrid language, but it's where 
> all the libraries are. All the "good" languages I've seen have a 
> crippling lack of half-decent libraries... [And usually, rather limited 
> documentation and unpolished toolchains.]

Nothing wrong with C or it's derivatives. Once you've acquainted 
yourself with the syntax, it's quite powerful.

Then you can do such convenient things as:

int * DoStuff(int i)
{
   //... code for DoStuff here ...
}

int *(*pfunc)(int);

int main(int argc, char **argv)
{
    pfunc = DoStuff;

    // This will call DoStuff (In C# pfunc would be called a "delegate")
    int *pWhatever = pfunc(4096);
}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.