473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

confusion with pointers and memory cell's

- as we know that the pointer points to a memory cell
- and each memory cell has the minimal size that the computer manage
(1 byte)
- that code

int *p;
int x;

p= &x;

- that mean that p will point to x which have the size of int type
4bytes
- so the pointer point to 4 cells in the memory not one cell
- here the memory address saved in p is the address of the which cell
one or two or three of four

Jul 12 '07 #1
2 1644
Virtual_X wrote:
- as we know that the pointer points to a memory cell
- and each memory cell has the minimal size that the computer manage
(1 byte)
- that code

int *p;
int x;

p= &x;

- that mean that p will point to x which have the size of int type
4bytes
- so the pointer point to 4 cells in the memory not one cell
- here the memory address saved in p is the address of the which cell
one or two or three of four
Which one is "one"? Which one is "four"?

Anyway, what you're asking is related to "Endianness". Please read
about it in Wikipedia.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jul 12 '07 #2
On Jul 12, 10:14 am, "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
Virtual_X wrote:
- as we know that the pointer points to a memory cell
- and each memory cell has the minimal size that the computer manage
(1 byte)
- that code
int *p;
int x;
p= &x;
- that mean that p will point to x which have the size of int type
4bytes
- so the pointer point to 4 cells in the memory not one cell
- here the memory address saved in p is the address of the which cell
one or two or three of four

Which one is "one"? Which one is "four"?

Anyway, what you're asking is related to "Endianness". Please read
about it in Wikipedia.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
thanks' i get it

Jul 12 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: N Yiannakoulias | last post by:
Hello all, I am trying to initialize a pointer inside an evil global structure. The pointer neighbour_id is of different size for each of the 10 cells initialized in the function main: ...
48
by: Daniel Rudy | last post by:
Hello, On a x86 machine, what is the format of a pointer in C? I know for a fact that the x86 p-mode uses a /selector:offset/ notation where the selector is defined in either the GDT or LDT. ...
16
by: Rob Meade | last post by:
Hi all, I am just making a few methods in my base class, one of which returns a horizontal line, formatted on the page as *I* want it..its basically a collection of three table rows. I...
4
by: Jesika | last post by:
I'm coming from a 3 year C background with some basic knowlegde on the Win32 API. I just started learning C# a day ago and I have a couple questions that I need cleared up that just have me very...
39
by: Martin Jørgensen | last post by:
Hi, I'm relatively new with C-programming and even though I've read about pointers and arrays many times, it's a topic that is a little confusing to me - at least at this moment: ---- 1)...
3
by: arochax | last post by:
Hi. I'm using XslTransform to transform a XML resulting of a Dataset into a Excel spreadsheet. But the object is not releasing its resources while transforming and I'm getting OutOfMemory...
10
by: william | last post by:
#include <stdio.h> int main() { char *str=NULL; char x="today is good!"; printf("%s", str); str=strtok(x," "); if (str=="today") //<==here is line that confuses me printf("they equals!\n");
35
by: Andrew Fabbro | last post by:
I have a need to create an array that is larger than size_t - 1, which I believe is the largest guaranteed array. I though I'd found salvation in FAQ 6.14, but it appears I am not understanding...
40
by: rjcarr | last post by:
Sorry if this is a completely newbie question ... I was trying to get information about the logging.handlers module, so I imported logging, and tried dir(logging.handlers), but got: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.