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
Product Launch
Updates
Today's Posts
Member List
Calendar
Home
Forum
Topic
C
erroneus statement
Collapse
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
agsupriya86
New Member
Join Date:
Mar 2007
Posts:
34
#1
erroneus statement
Jul 8 '07, 02:39 PM
which is the erroneous statement among following??
Int *p[3]
Int (*p)[3]
(Int *)(int ,int)
Int (*p[3])
Int *(p[3])
weaknessforcats
Recognized Expert
Expert
Join Date:
Mar 2007
Posts:
9214
#2
Jul 8 '07, 03:17 PM
This looks like a class assignment.
So, write down what you think each statement means and send me your statements. I'm guessing that the erroneous statement will identify itself when you cannot write down what it means.
Comment
Post
Cancel
agsupriya86
New Member
Join Date:
Mar 2007
Posts:
34
#3
Jul 8 '07, 05:26 PM
Originally posted by
agsupriya86
which is the erroneous statement among following??
Int *p[3]
Int (*p)[3]
(Int *)(int ,int)
Int (*p[3])
Int *(p[3])
i guess the first one is an array of pointers..
second one is pointer to an array..
third one is a function returning a pointer to an int and having two ints as an arguments..
fourth one is again an array of pointers..
5th one is a pointer to an array..but am not sure abt it..please verify me ..
Comment
Post
Cancel
weaknessforcats
Recognized Expert
Expert
Join Date:
Mar 2007
Posts:
9214
#4
Jul 8 '07, 06:38 PM
OK, here you go:
Int *p[3] //p is an array of 3 pointers-to-int
Int (*p)[3] //p is a pointer to an array of 3 int
(Int *)(int ,int) //garbage
Int (*p[3]) //p is an array of 3 pointers-to-int
Int *(p[3]) //p is an array of 3 pointers-to-int
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment