This is likely a very basic question --- but I'm not getting the same output when I use the IDOS->Printf versus printf. See below. It looks like the pointers are not getting assigned correctly with the DOS function. Is this due to the 64-bit alignment issue?
----------------------------
CONST_STRPTR teststring = "mystring";
IDOS->Printf("%s -%p- -%c- -%p- -%c- end\n",teststring,teststring,*teststring,teststring+1,*(teststring+1));
printf("%s -%p- -%c- -%p- -%c- end\n",teststring,teststring,*teststring,teststring+1,*(teststring+1));
--------------------------
OUTPUT
mystring -0x3e607080- -- -0x006d3e60- -- end
mystring -0x3e607080- -m- -0x3e607081- -y- end
IDOS->Printf output not the same as printf
-
- Posts: 73
- Joined: Sat Dec 08, 2012 7:58 pm
- colinw
- AmigaOS Core Developer
- Posts: 218
- Joined: Mon Aug 15, 2011 10:20 am
- Location: Brisbane, QLD. Australia.
Re: IDOS->Printf output not the same as printf
All arguments to Printf() are 32 bit minimum width, (VARARGS68K), your format string must specifiy them that way.
ie; %ld instead of %d - %lc instead of %c - etc...
Please review the DOS Printf() / VPrintf() / VFPrintf() autodocs.
ie; %ld instead of %d - %lc instead of %c - etc...
Please review the DOS Printf() / VPrintf() / VFPrintf() autodocs.
-
- Posts: 73
- Joined: Sat Dec 08, 2012 7:58 pm
Re: IDOS->Printf output not the same as printf
Thanks for the quick response and clarifications!