Hey.. good To have your Question . Well lemme try to elaborate things here
as i cannot use WhiteBoard . So Srry guys... :(

Well partly you have answered your question and some part can even be
reflected in the above thread of virtual - physical mem mapping. using MMU..
So I wont go beyond MMU.

Here it goes.

Well if you write a prg.. when it bcme process, OS assign a  bunch of ID as
Address which it can use in sense. However, this address are not what is
real add.there is what MMU kicks in...

So if 0xff U think is assigned its not actually its is mapped with something
like this .. PID + 0x0ff = xyzxyx( Hell anything let the OS answer it). that
MMU issue.

So, the question here is wat the case if the house you want is not in your
area. Dude you are not a kind to cry infront of your parent to get one for
U..

Similarly, OS will not give you the access directly to physical Mem ( under
his control ) hence, the pointer allocation may fail.

Now here comes the compiler of whatever type say g++ which may silently say
dude that house you want is unavailable or may keep quiet... but complains
when you are in need to stay in that house , or rather when you try to put
something within it.

So, the direct answer to your question is definitely your design of
Compiler. but rather I would like to say, the pointer allocation fails to
prove your address allocation.

Does that makes sense......... lemme know for more without whiteboard.. :)

Regards
 Prem




On Thu, Jul 28, 2011 at 1:26 PM, MANNU <[email protected]> wrote:

> @Prem: Each program is provided with a pool of address, which consist
> of heap, stack etc.
>             My question is that if I write an address 0xff which is
> not provided to that program then
>             what will be the output?
>
> On 7/28/11, Prem Krishna Chettri <[email protected]> wrote:
> > First of all this is a good Question as this is use regularly in Device
> > Driver kind of Development Mode and hence there is no question of Not
> > Possible.
> >
> > So how to Do it is Question. which is as follows :-
> >
> > Point your pointer to mem add that U want and Now this Mem Add is HEX
> guys
> > (Not 4 or 5 or any base 10 val) , so put it as 0x(whatever U want).
> >
> > Do whatever  U want to do on that address using that pointer now.
> >
> > The Code above is correct but the implementation is wrong so...
> >
> >
> > #include<stdio.h>
> > int main()
> > {
> >        int *p = (int *)0xff;
> >       // *p = 4; /** Dude can U put hex val here .. Oh its already
> assigned
> > to 0xff..  **/ Now print it cout<<p<<endl;
> >        return 0;
> > }
> >
> > Regards
> >  Prem
> >
> > On Thu, Jul 28, 2011 at 10:44 AM, Tyler Durden <
> [email protected]
> >> wrote:
> >
> >> @Ankita: So when is 4000 memory address is allotted?? I mean what use
> does
> >> int *p = 4000 serve here??
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Algorithm Geeks" group.
> >> To view this discussion on the web visit
> >> https://groups.google.com/d/msg/algogeeks/-/0OU6tMQudMoJ.
> >>
> >> To post to this group, send email to [email protected].
> >> To unsubscribe from this group, send email to
> >> [email protected].
> >> For more options, visit this group at
> >> http://groups.google.com/group/algogeeks?hl=en.
> >>
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group at
> > http://groups.google.com/group/algogeeks?hl=en.
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to