Hello,
I am testing the TagItem structure in my function
Here is some parts of the code inspired by the AmigaOSWiki.
void Test(uint32 n, ...) { uint item = 1; struct TagItem *tags = (struct TagItem *) &n; // Here may be the problem. How does gcc read the stack? struct TagItem *ctags=IUtility->CloneTagItems (tags); //not useful, just for testing the function, at least I think. struct TagItem *ltags=ctags; struct TagItem *tag; while (tag = IUtility->NextTagItem (<ags)) { uint32 titag = tag->ti_Tag; uint32 tidata = tag->ti_Data; cout <<"Element "<<item<<": First="<<titag<<", Second="<<tidata<<endl; ++item; } IUtility->FreeTagItems (ctags); } int main(int argc, char *argv[]) { Test(1,4,2,46,3,31,4,65,5,86, TAG_END); return 0; <cpp-qt> Here the output : Element 1: First=1297767648, Second=1866413944 Element 2: First=1297767680, Second=1866413840 Element 3: First=5, Second=86 As you can read, I only obtain 5 and 86. I think that it prints the address and not the values but I don't know why. I would want to undersand better how the methods and TagItem work. I mean, how the parameters of Test() are converted into TagItem and vice-versa when they are not only int but float, pointers, strings...? The purpose of all this is of course to use Test() with a variety of parameters. Thanks for reading.