How do I load address location 7890 with value A1B2 in C?
Does it require pointers?
How do I load address location 7890 with value A1B2 in C?
Does it require pointers?
Why the heck would you need to write to a specific location?
that's one of the dumbest responses I've ever heard around here....Captain Penguin Why the heck would you need to write to a specific location?
>>How do I load address location 7890 with value A1B2 in C?
int *pointy = (int *)0x7890;
or alternatively...
&pointy = 0x7890;
>>that's one of the dumbest responses I've ever heard around here....<<
Why yes...yes it is.
Sigh.Originally posted by SavesTheDay
that's one of the dumbest responses I've ever heard around here....
My train of thought was "well why would you need to write to a specific memory address? For that information to be of value, it would have to be assigned to a variable, right? Thus why not just create a variable at a random location and use a pointer to that one. Whats the point of a specific locale?"
Apparantly I am wrong, but I had no clue since my C skills are not very advanced. Hell, all I know I learned from "C for Dummies"
I'd appreciate a more constructive response than simply insinuating that I'm a dumbass (regarldess of the facts). e.g., you could have told me why anyone would want to write to a specific memory location, preventing further dumbass comments on the subject.
Last edited by Captain Penguin; 02-14-2002 at 10:17 PM.
Thanks Ken.
I guessed at the second method , but was unsure.
The first method I'll have to study.
I'm learning C and there are (as I'm sure you're aware)
some obscure things that are difficult to grasp. Getting
a memory location is easy, the other way around is just
not spelled out in the texts that I have. This was the first
question that I could not find an answer to by searching
through this forum. What would you guys recommend as
a reference to find these hidden gems of programming?