peter green wrote: >>> In C afaict you cannot copy structures through assignment or return them >>> as a function result. >>> >> >> You can do both. >> > Well I couldn't with the C compiler i've been working with recently (and > old version of gcc), maybe this changed in a more recent C standard but > it is certainly not behaviour that can be relied opon in code that is to > be portable (much like the ability to declare variables anywhere in a > block can't be relied on). How old is your copy of GCC? Returning structs worked for as long as I can remember. Returning a structure doesn't seem much more difficult than returning an int or a char. If a function is defined as returning a struct, it just needs to return a pointer, and the struct definition tells the compiler how many bytes there are in the struct and which fields they belong to. Vitaliy -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist