char buffer[]="foobar"; I know that buffer is char* pointer to the first element so buffer==&buffer[0] but why &buffer==buffer? &buffer should give the memory address of the buffer char* and NOT the address of the first element?
Additionaly,What would happen when i do (int)buffer ?
&bufferandbufferdo in fact have different datatypes, so you should at least get a warning if you actually code up the Expression&buffer == buffer. Try it.(int)buffer, the compiler will first turnbufferinto a pointer and then intepret the bits of that pointer as andint. This might also result in a warning if the pointer is bigger than the int, but I am not sure.bufferis not a pointer (char *) - it's an array (char []) - try doingbuffer++if you want to see one important difference. It will decay to a pointer is various cases though.