I am trying to teach myself about DLLs and so I found code for one and created a Win32DLL and added the file. Executing it it asks me which .exe to use. What I want to know is is this DLL code safe to run should I write a small .exe to run it and how can I or where can I go to learn how to write such code?
Here's the code:
/* nag_save_random_state(g05cfc) Example Program
*
* Copyright 1990 Numerical Algoritms Group.
*
* Mark 1, 1990.
*/
#include <nag.h>
#include <stdio.h>
#include <nag_stdlib.h>
#include <nagg05.h>
main()
{
Integer seed = 0;
Integer i, istate[9];
double x[5], xstate[4];
Vprintf("g05cfc Example Program Results\n");
g05cbc(seed);
for (i=0; i<5; ++i)
{
c[i]=g05cac();
if (i==1)
g05cfc(istate,xstate);
}
for (i=0;i<5;++i)
Vprintf("%9.4f%s", x[i], (i%5==4 || i==4)?"\n":" ");
for (i=0;i<5;++i)
{
x[i]=g05cac()
if (i==1)
g05cgc(istate,xstate,NAGERR_DEFAULT);
}
for (i=0;i<5;++i)
Vprintf(%9.4f%s",x[i],(i%5==4 || i==4)?"\n":" ");
exit(EXIT_SUCCESS);
}
www.edwardtisdale.com