Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
You are declaring a null pointer for your temporary variable. You should declare an array instead. Make sure the array is large enough to store the entire string, including the null terminator.
Your itoa() function prints signed integers, but the address is an unsigned integer. Your itoa() function handles 32 bits, but the values you want to print are 64 bits.
There may be other problems with your code as well; these are only the ones I spotted after a quick look.
I'm not sure how else to explain it. The wiki example code uses "..." to show you where you should insert your code. You did not follow those directions, so the example doesn't work.
Not all entries in the memory map are RAM. You will need to check the entry type to see if it should count towards the total RAM.
Your code doesn't handle odd cases like overlapping memory ranges or ranges that aren't aligned to page boundaries, but those are rare.