why in the below code int *p = 22 will give compile time error and ptr will print the value successfully .
int main()
{
/*taking a character pointer and ass
Because the string is actually an array of char's and when assigning an array to a variable, the arrays will behave as a pointer to the first element of the array. This can be confusing. More on this here:
when does a array act as a pointer in c?
The integer on the other hand is just an integer, not an array of integers.