Hi this is probably a stupid question, but I don't understand why the "&" prints the text (beginning at index 2 of course), isn't & an address??
result:
what is it: e brown fox
would it maybe be *str[2] instead?
thank you
Code:
#include <stdio.h> int main() { char *str = "the brown fox"; printf("what is it: %s \n", &(str[2])); return 0; }
what is it: e brown fox
would it maybe be *str[2] instead?
thank you
Comment