Hi, beginner over here.
I just started out with pointers and I have simple of understanding of how pointers work, they basically point to the address of an object. However what I could not understand is how the pointers work with 'char' data type.
My Question - Why doesn't the program print the address of 'c'. To Display the address of 'c', I have to write cout << &p;
But this is not the case with int or float, writing cout << p; prints the address of the variable.
As Far as I know it doesn't really matter if main returns a int.
It is fine if you explicitly do not 'return' a value from main. However, the main function itself should be of type int main() so as to enable the compiler to return a default value.
Yeah I Realized That by the pointer, pointing to a pointer method.
the link does help but it creates more questions than answers, Eg: why does << operator treat char as string, what is static_ cast.
I guess its best to leave it until I come across it in Class