I am a new C programmer. I use turbo c on a DOS operationg system. Please restrict your replies to Turbo C on DOS. Thanks.
My problem.
I have two databases which differ slightly but significantly. The databases are defined as struc which gives the field description. My program essentially performs the same operations on both the data bases. eg:
struc {
fields } datarec1;
struc {
fields } datarec2 ;
my_program1
{
datarec1.fieldname (some operation)
}
my_program2
{
datarec2.fieldname (some operation)
}
I have had to write two functions to do essentially the same thing. The only difference is that one accesses the struc datarec1 the other datarec2.
My question.
Is there some way in which I can use datarec1 and datarec2 in the same function. In other words can the same function be used to manipulate the two strucs which differ from each other and if yes, how does one do it?
Secondly, by doing so, will it result in significant drop in program size or execution speed?
Thank you.
Subra if you find this useful let me know at vksubra@icenet.net
My problem.
I have two databases which differ slightly but significantly. The databases are defined as struc which gives the field description. My program essentially performs the same operations on both the data bases. eg:
struc {
fields } datarec1;
struc {
fields } datarec2 ;
my_program1
{
datarec1.fieldname (some operation)
}
my_program2
{
datarec2.fieldname (some operation)
}
I have had to write two functions to do essentially the same thing. The only difference is that one accesses the struc datarec1 the other datarec2.
My question.
Is there some way in which I can use datarec1 and datarec2 in the same function. In other words can the same function be used to manipulate the two strucs which differ from each other and if yes, how does one do it?
Secondly, by doing so, will it result in significant drop in program size or execution speed?
Thank you.
Subra if you find this useful let me know at vksubra@icenet.net