Hi,
I am working on Turbo C for DOS .
First I have made a sample.c which contains sample() function and i have generated the objected file sample.obj.
In another file ( test.c) i have opened this file with fopen and this address is casted to funcp function pointer and called the that function pointer.
Is this the correct way of doing? Is this the way how DLLs are work in core level ( Actually i dont know how DLLs work in background )
Following is the my source code
First File :
#include <stdio.h>
void main()
{
printf("Hai Suri"
return;
}
Second File :
#include <stdio.h>
FILE *fp;
void main()
{
void (*funcp)();
fp = fopen("sample.obj","rb"
if ( !fp )
printf("File Cannot be opened"
else
{
funcp = ( void (*)()) fp;
funcp();
}
fclose(fp);
}
anyway this program is running but going in infinite loop
Please clarify me .
I am working on Turbo C for DOS .
First I have made a sample.c which contains sample() function and i have generated the objected file sample.obj.
In another file ( test.c) i have opened this file with fopen and this address is casted to funcp function pointer and called the that function pointer.
Is this the correct way of doing? Is this the way how DLLs are work in core level ( Actually i dont know how DLLs work in background )
Following is the my source code
First File :
#include <stdio.h>
void main()
{
printf("Hai Suri"
return;
}
Second File :
#include <stdio.h>
FILE *fp;
void main()
{
void (*funcp)();
fp = fopen("sample.obj","rb"
if ( !fp )
printf("File Cannot be opened"
else
{
funcp = ( void (*)()) fp;
funcp();
}
fclose(fp);
}
anyway this program is running but going in infinite loop
Please clarify me .