Mar 2, 2003 #1 JGSH Programmer Feb 23, 2003 6 US Hi, I need help on an algorithm that will help me print out memory addresses per line. It will be up to 7 hex digits. So it will basically print out... 0000000 0000010 0000020 etc 00000f0 0000100 all the way to fffffff thanks, Jon
Hi, I need help on an algorithm that will help me print out memory addresses per line. It will be up to 7 hex digits. So it will basically print out... 0000000 0000010 0000020 etc 00000f0 0000100 all the way to fffffff thanks, Jon
Mar 3, 2003 1 #2 Zyrenthian Programmer Mar 30, 2001 1,440 US by default cout<<ptr<<endl; should print out in hex. There is always sprintf where you write the memory address into a character buffer sprintf(buffer,"%08x",ptr); cout<<buffer<<endl; Is that what you are looking for? Matt Upvote 0 Downvote
by default cout<<ptr<<endl; should print out in hex. There is always sprintf where you write the memory address into a character buffer sprintf(buffer,"%08x",ptr); cout<<buffer<<endl; Is that what you are looking for? Matt
Mar 3, 2003 1 #3 danielhozac Programmer Aug 21, 2001 2,058 SE Something like this might work. [tt]#include <stdio.h> int main() { int i; for (i = 0; i < 0xfffffff; i++) printf("%08x\r\n", i); return 0; }[/tt] //Daniel Upvote 0 Downvote
Something like this might work. [tt]#include <stdio.h> int main() { int i; for (i = 0; i < 0xfffffff; i++) printf("%08x\r\n", i); return 0; }[/tt] //Daniel