You're trying to drive in a nail using a screwdriver, to use a popular analogy. Prolog is not C and solving problems in Prolog is fundamentally different from solving them in C.
Printing the value of a variable is easy to do, for example:
main :-
X = 5,
io:format("X = ~w~n", [X]).
but you can't get the address of X like you can in C. And why would you want to? The address could be different next time since Prolog has automatic garbage collection.
If you want to learn Prolog, forget about trying to write Prolog programs which look like C programs, and try to solve actual problems instead. You could try out the Project Euler series of problems, for example.