On Tue, 12 Dec 2006, umesh pandey wrote: > ypedef struct {...} mystruct_t; > > mystruct_t anInstance; > > char * sendbuffer = (char *)&anInstance; > At the source computer I tried to print the char* sendbuffer by using > > printf("Data=%s",sendbuffer);
Hi Umesh, That printf() is quite unlikely to produce anything sensible (and unless there is a 0 byte somewhere in anInstance it might try to print your computers entire memory..). Us telling the compiler that it should consider anInstance as an array of char:s does not mean that it becomes a zero-terminated string that we could give to printf. To determine whether anInstance got the right format or not you should test to decode it with the same code as FlightGear uses. Either by copying it to your application or by tracing fgfs or adding some temporary printouts to it. (I'd do the latter as that would also tell me whether my UDP-packets got through at all.) > But I cannot see any data packets formed.Is that i am using wrong format for > printf or is the problem with something else!!!!!Please help!!!!! I have a simple application that sends UDP packets to FlightGear here: http://www.gidenstam.org/FlightGear/HeadTracking/ However, it does not talk to NetFDM but to a head tracking component that only exists as a patch somewhere at the moment. /Anders -- --------------------------------------------------------------------------- Anders Gidenstam mail: andersg(at)gidenstam.org WWW: http://www.gidenstam.org/FlightGear/JSBSim-LTA/ ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel