Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Member List
Calendar
Today's Posts
Home
Forum
Topic
C
pointer value
pointer value
Collapse
This topic is closed.
X
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
JD
#1
pointer value
Nov 15 '05, 01:08 AM
int (*a)[10];
a++;
what will be the value of a?
Michael Mair
#2
Nov 15 '05, 01:08 AM
Re: pointer value
JD wrote:[color=blue]
> int (*a)[10];
> a++;
> what will be the value of a?[/color]
As always with ++ on a pointer:
(unsigned char *)a + 1*sizeof *a
As a points to array 10 of int, sizeof *a == 10 * sizeof (int).
As you have not initialised the pointer, the behaviour is
undefined.
Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Comment
Post
Cancel
Emmanuel Delahaye
#3
Nov 15 '05, 01:08 AM
Re: pointer value
JD wrote on 30/07/05 :[color=blue]
> int (*a)[10];
> a++;
> what will be the value of a?[/color]
a + 1
--
Emmanuel
The C-FAQ:
http://www.eskimo.com/~scs/C-faq/faq.html
The C-library:
http://www.dinkumware.com/refxc.html
"Clearly your code does not meet the original spec."
"You are sentenced to 30 lashes with a wet noodle."
-- Jerry Coffin in a.l.c.c++
Comment
Post
Cancel
Previous
template
Next
Working...
OK
OK
Cancel
👍
👎
☕
Comment