[Tinyos-help] How to declare a pointer to user defined structure

Michael Schippling schip at santafe.edu
Thu Dec 11 13:22:37 PST 2008


That looks fine to me...

Perhaps there is something else wrong in the file before
you get to the declaration? Try moving it around. And then
start eliminating stuff...my suspicious nature would start
with the nx_ things...

MS

JD wrote:
> Greetings Folks,
> 
> I've a stupid (I believe) question.  I've following structure defined in 
> header file,
> 
> typedef nx_struct __msg
> {
> CommonHeader cmnHdr;
> 
> nx_union
> {
> InitMsg    __iMsg;
> AckMsg   __aMsg;
> } __msgType;
> 
> } ActiveMessage;
> 
> Now in the module implementation, I try to declare a pointer as follows,
> 
> ActiveMessage *pMsg = NULL;
> 
> Doing so, nesc gives me following error,
> "Syntax errorr before * "
> "pMsg undeclared"
> 
> Nothing clicks me if what exactly I'm doing wrong out here. I sure its 
> something really stupid, I guess.
> 
> Please let me know if you find me doing thing wrong.
> 
> Thanks,
> JD
> ---------------------------
> Love All, Serve All
> ----------------------------
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

-- 
Platform: WinXP/Cygwin
TinyOS version: 1.x, Boomerang
Programmer: MIB510
Device(s): Mica2, MicaZ, Tmote
Sensor board: homebrew



More information about the Tinyos-help mailing list