hi
i m declaring a structure globally & there is func1 & main.
i m assigning the value to variable(this is a pointer) of structure in
fun1 & want to print it in main.
this is same kind of problem not the actual code. pls help.
static struct des_rbuf{
unsigned int ind;
long long buf_adr;
unsigned int len;
}desc_rbuf[512];
static l;
int main()
{
fun1();
for(p=0;p<l;p++ )
PRINT("%u\t\t\t \t%x\t\t\t
%u",desc_rbuf[p].ind,desc_rbuf[p].buf_adr,desc_r buf[p].len);
//here it is printing all the values 0
}
fun1
{
desc_rbuf[l].ind=i;
desc_rbuf[l].buf_adr=(rxd->buffer_addr&0x FFFFFFFF);
desc_rbuf[l].len=rxd->length;
l++;
//here the value desc_rbuf[l] is printing right
}
i m declaring a structure globally & there is func1 & main.
i m assigning the value to variable(this is a pointer) of structure in
fun1 & want to print it in main.
this is same kind of problem not the actual code. pls help.
static struct des_rbuf{
unsigned int ind;
long long buf_adr;
unsigned int len;
}desc_rbuf[512];
static l;
int main()
{
fun1();
for(p=0;p<l;p++ )
PRINT("%u\t\t\t \t%x\t\t\t
%u",desc_rbuf[p].ind,desc_rbuf[p].buf_adr,desc_r buf[p].len);
//here it is printing all the values 0
}
fun1
{
desc_rbuf[l].ind=i;
desc_rbuf[l].buf_adr=(rxd->buffer_addr&0x FFFFFFFF);
desc_rbuf[l].len=rxd->length;
l++;
//here the value desc_rbuf[l] is printing right
}
Comment