I wrote the following function and it is working fine, but my problem is i want to write forward pointer address in present pointer field.
I will explain in code.
please check line numbers 10, 11, 12, 13 in the following code..
void create_fbeCodeDat()
{
int checkSum=0;
fwrite(&signature,1, 4, bin_fp);//signature=0xabcd0001
fwrite(&version, 1,4,bin_fp);//Version番号
fseek(bin_fp,4,SEEK_CUR); //FBD Program code
fseek(bin_fp,2,SEEK_CUR); //not used
fwrite(&fbdStepno,1,2,bin_fp); //FBD step No.[N1]
fseek(bin_fp,4,SEEK_CUR); //const data offset
//Here i have to write the address of next fbdstepno*4+1 bytes
//consider fbdstepno=4, here in 4 bytes have to write address of 5th byte address
// for ex: next 5th byte adress has to be write here in 4 bytes
//fwrite( addr(5th byte), 1,4, bin_fp); //how to write 1st argument
// actually in the program here i have to write the address of buffList[buf].fbCodeAddr in 4 bytes. for buf=0, have to write bufflist[0].fbCodeAddr in 4 bytes
// for buf=0 and 1, have to write bufflist[0].fbCodeAddr in 4 bytes, and bufflist[1].fbCodeAddr in 4 bytes
//and so on... and next the following code continues..
for(int buf=0; buf<buffList.size();++buf)
{
fwrite(buffList[buf].fbCodeAddr,1,buffList[buf].tmpAddr+4-buffList[buf].fbCodeAddr, bin_fp);
}
fwrite(&checkSum,1,4,bin_fp);//sum値
}