I am not a 100% sure on this but I believe pointers work with logical memory.
When a C program is compiled, the compiler works in such a manner that the program can be placed any where in the physical memory.
I dont think that you can access a physical memory location from within the program
Then how can pointers be dangerous if they access logical addresses, CPU generated addresses keep on changing after every access?
i want to know, what kind of addresses do pointers deal with?
That's not specified.
and how can i access a particular memory area using pointers?
It's not portable, but traditionally that's been done by something like this:
/* Point to address 0x12345678 and treat it as an int */ int *p = (int*)0x12345678;
how can i access a particular memory area using pointers?
Why do you want to do this? What kind of memory area is this? Maybe there are OS API functions that do exactly what you want.
For example, if you want to write a cheat engine on windows, you can use these two to mess with memory of other processes:
It's a function of your OS and compiler.
If you're using a protected OS and your compiler is compatible with your OS (say Linux+gcc or Windows+visual studio), then you're dealing with logical addresses. You can invent whatever address you like, but if you choose badly, the OS will just serve up your ass on a plate with a segmentation fault.
If you're using a protected OS and your compiler is NOT compatible with your OS (say Windows+TurboCrap), then you're dealing with physical addresses in a virtual machine. You can invent whatever address you like, but the VM will either allow it or give you some fake answer (which is mostly in keeping with what the real machine would do).
If you're using a real mode OS (eg. DOS), or no OS at all, then you're using real addresses, and you can do whatever the hell you like. This includes destroying your hardware if you choose badly. There is no safety net, you're on your own.
no no frnds whan we declaire any variable or pointer variable than its cover any very memory space its allocated any where in primary memory and its does not change after compiletion.
Your question seems upside down:
"How I can use this solution, which does not work or does not work allways, to problem I have which I do not tell to you"
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
OK, so HostGator for some reason no longer allows gcc/g++ access unless you have a Designated Server account, which is a lot of money to spend just to compile my "Hello World" program. Thus I figured I'd compile at home, then upload. Program is your regular old bare-bones Hello World ...
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.
Private Sub btn_addline_Click(ByVal ...