i am using DOS and Turbo-c 3.0
I have two small programs, i. to create a data file
ii. to read and index the data file.
the structure of the data file and the offending code is as below.
typedef struc
{
char custno[7];
char custnm[31];
char amtnum[3];
} CUSTOMER;
CUSTOMER cust;
void main()
{
int csize;
csize = sizeof(cust);
}
i have included the necessary files and the program compiles without error. in the data base creation programme, the value of csize is shown correctly as 41, while in the indexing programme, the value of csize is shown wrongly as 42. why?
please help.
subra if you find this useful let me know at vksubra@icenet.net
I have two small programs, i. to create a data file
ii. to read and index the data file.
the structure of the data file and the offending code is as below.
typedef struc
{
char custno[7];
char custnm[31];
char amtnum[3];
} CUSTOMER;
CUSTOMER cust;
void main()
{
int csize;
csize = sizeof(cust);
}
i have included the necessary files and the program compiles without error. in the data base creation programme, the value of csize is shown correctly as 41, while in the indexing programme, the value of csize is shown wrongly as 42. why?
please help.
subra if you find this useful let me know at vksubra@icenet.net