• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Forceful Memory Allocation

## Recommended Posts

Is it possible to do forceful memory allocation? e.g, is
  #include int *a int t void main() { a*t; &t = A001D; t=123; } 
possible? Just wondering... it could help to organize variable location?

##### Share on other sites
Null and Void    1088
What do you mean by forceful memory allocation? Your code example didn''t help me much since it doesn''t make sense . Do you mean writing to a specific place in memory? If that''s what you mean then yes it is technically possible, but it''s more likely that your application will segfault. You''d basically do it like this:
  int *Fish = 0x12341234;*Fish = 999;

That would try to set the memory (of sizeof(int) bytes) at 0x12341234 equal to 999. Of course, that''s going to cause your application to crash . You may also want to look at ''placement new''.

[Resist Windows XP''s Invasive Production Activation Technology!]