Stack Exchange network consists of 178 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
CS50 Stack Exchange is a question and answer site for students of Harvard University's CS50. It only takes a minute to sign up.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
In this example, what will it happen if I assign for example:
pk = 6;
You will get the following message in CS50 IDE: error: incompatible integer to pointer conversion assigning to 'int *' from 'int'.
error: incompatible integer to pointer conversion assigning to 'int *' from 'int'
In the code above, pk is a pointer to an integer, not an integer itself. Therefore, assigning an integer to it will give you a compile-time error.