Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Why do so few people know the difference between arrays and pointers.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Arthur J. O'Dwyer, post: 1713466"] The simplest way out of this dilemma, in the context of the C programming language (which is always the context in this newsgroup), is to reserve the use of the word "pointer" for the C language's pointers, and to use the English term "address" for what you seem to be calling a "pointer." Thus: 'main' calls the function 'foo' with an argument which is a pointer to an 'int'. 'main' calls 'foo' with a pointer to 'int'. 'main' calls 'foo' with a pointer which holds the address of the array 'bar'. 'bar' is an array[100] of 'int'. The address of 'bar' is also the address of the first element of 'bar'. The expression 'bar' decays to a pointer to the first element of 'bar'. All pointer values have associated types. Addresses do not have types. The unary '&' operator yields a pointer to the operand object. The unary '&' operator yields the address of the operand object as a value of type "pointer to quux." All clear, no? -Arthur [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Why do so few people know the difference between arrays and pointers.
Top