Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
What is the difference between if (p == q) and if (*p == *q)?
+1
vote
asked
Oct 10, 2019
by
anonymous
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
4 Answers
0
votes
answered
Oct 11, 2019
by
rohan ag
(
1,310
points)
p==q; //compare the two memory addresses
*p=*q;//compare the two content from that address(p and q)
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
+1
vote
answered
Oct 11, 2019
by
Harsha
(
380
points)
edited
Oct 15, 2019
by
Harsha
if(p==q) -- it means that it checks the "address "of p and q
if(*p==*q)--it means that it checks the "values" of p and q
so p is never equals to q
*p is may be equal to *q (depends on given programm)
commented
Oct 11, 2019
by
Harsha
(
380
points)
if you have doubt message me insta id(gutsboy_harsha)
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
0
votes
answered
Oct 12, 2019
by
anonymous
P and Q are variables. (p==q) in this condition compare the values of variables.
(*p==*q) in this condition compare address of variables that's are store values.
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
0
votes
answered
Nov 7, 2019
by
dheeraj
(
1,090
points)
for (p==q)we can able to insert only one value but,for (*p==*q) we can able to insert many values
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...