You don't seem to have set buf to point to anything...
MS

Jun Zhang wrote:
> Hello, everyone. I am new to tinyos and nesc. and I have the following 
> data strucuture 
>  
> typedef nx_struct rt_link { 
> nx_addr_t target; 
> nx_addr_t nexthop; 
> } rt_link_t; 
>  
> typedef struct rt_entry { 
> double some_double; 
> uint8_t some_int; 
> } rt_entry_t; 
>  
> uint8_t flag = 0x01; 
> uint8_t i=0; 
> rt_link_t * buf; 
> rt_entry_t table[10]; 
>  
> if ( flag & 0x01) 
> { 
> buf[i].target = table[i].some_double; 
> buf[i].nexthop = table[i].some_int; 
> } 
>  
> and if I use 
> if ( flag == 1) 
> { 
> buf[i].target = table[i].some_double; 
> buf[i].nexthop = table[i].some_int; 
> } 
>  
> I will get different value from buf[0], whats the difference? 
> 
> -- 
> Kind Regards
> 
> Jun
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to