UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Will the expression *p = p be disallowed by the compiler?

Asked by Last Modified  

Follow 0
Answer

Please enter your answer

Test Engineer

No, Because, here even though the value of p is accessed twice it is used to modify two different objects p and *p. i.e. let us take the value of p as 5, the address where p is stored at 100 location. now statement *p=p will override the value 200 with 5 i.e. P location is shifted from 100 to 5.
Comments

Thanks for the question Atharva, No because even though the value of p is accessed twice it is used to modify two different objects p and *p. Thanks, Team DishaaPro www.dishaapro.com
Comments

Compiler should disallow or at the least warn you, As no types were mentioned and given you are de-referencing using *p so presuming p is a pointer, For sake of simplicity, presume p is of type int* ie: int *p; then in statement below, lhs is of type int and rhs is of type int*, you shouldn't ...
read more
Compiler should disallow or at the least warn you, As no types were mentioned and given you are de-referencing using *p so presuming p is a pointer, For sake of simplicity, presume p is of type int* ie: int *p; then in statement below, lhs is of type int and rhs is of type int*, you shouldn't assign int* to an int. *p = p If you really want to do that (hope you understand what you are doing with your memory), then you should force typecast it to (int*), so that compiler doesn't generate a warning. Team SG-Tech.in read less
Comments

View 1 more Answers

Related Questions

What is the difference between #include and #include "file" ?
#include is meant for including standard library files, where as #include "" is for the local/ custom header files.
Kajol
In Java programming, what are the differences between the functions of 'int' and 'int []' when working with an array?
INT type of function return type is int where as for int return type is int array.
Kalpana
0 0
5
What are the types of linkages in C Programming?
Type of linkage Type of object Accessibility external external throughout the program internal external a single file none internal local to a single function
Akash
0 0
9
in c : i want run time input: data=[name:raj,age:20] output: value[0]=raj value[1]=20 i want c code
Make use of Command line argument and access using argv,argc.
Vanaraj
What are the control statements in C language?
Control statements in C are constructs that allow the program to make decisions and control the flow of execution based on certain conditions. The primary control statements in C include if-else statements,...
Jitender
0 0
6

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Some interview questions and answers for fresher level on Pointers
What is a void pointer? Void pointer is a special type of pointer which can reference or point to any data type. This is why it is also called as Generic Pointer. As a void pointer can point to...

4 Things Every Tech Startup Needs to Know About The Coaching Industry
Knowledge on any subject is widely available to those who wish to learn. However, just gathering knowledge from other people doesn’t guarantee results in business. Results come from applying what...

Software Development Training In Jaipur
Satyam Web Solution provides website designing &development and software designing &development training in Jaipur for various stream’s students. MCA 6 month Industrial Training/Internship B....

Can we store different data types in a stack?
Yesterday, one of my Facebook friend asked me this question. My answer is "yes", and in this post I will discuss how could we do this.I am a great supporter of working with unions and I will be using union...

C Program-Prime Number
/*WAP to print a number entered by the user is prime or not*/ //Header files #include<stdio.h>#include<conio.h> //Main function void main(){ int num,i; //Function for clearing screen clrscr();...
S

Recommended Articles

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...

Read full article >

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more