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
Suri
NA
113
13k
Are calls A and B semantically identical? Which is preferable?
Apr 13 2021 6:35 AM
I have a simple question.
#include void inc_mutable(int& x) {++x;
}
void
inc_pointer (
int
* x) {++(*x);
}
int
main() {
int
x = 10;inc_mutable(x);<- Ainc_pointer(&x);<- Bstd::cout << x;
}
1) Are calls A and B semantically identical?
2) Which is preferable?
Reply
Answers (
1
)
Hi, how does this work without segfault?
When i am trying to compile this with gcc it's saying "undefined refer