TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
rahul ummadisetti
NA
47
2.3k
C++ Pointer to an Array
Apr 18 2019 5:01 AM
int
array[]{1,31,36,65,96,65};
int
* array_ptr(array);
cout <<
"array :"
<< array << endl;
cout <<
"&array+1 :"
<< &array+1 << endl;
cout <<
"*(&array+1) :"
<< *(&array+1) << endl;
cout <<
"(*(&array+1)-array) :"
<< (*(&array+1)-array) << endl;
output :
array :0x7fffffffde20
&array+1 :0x7fffffffde38
*(&array+1) :0x7fffffffde38
(*(&array+1)-array) :6
*(&array+1) and &array+1 refer to the same memory location.
compiler throwing an exception while trying to get the size of the array using a pointer as ((&array+1) - array)
what is the difference between ((&array+1)-array) and (*(&array+1)-array)
Reply
Answers (
2
)
how to export data's in pdf using vc++ 6.0 mfc
how to solve error "stack around variable was corrupted" ?