They are pointers! How else?
This is a discussion on Multidimensional arrays returning. within the C Programming forums, part of the General Programming Boards category; They are pointers! How else?...
They are pointers! How else?
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
Like this?
Code:#include <stdio.h> int main(void) { printf("0x%p\n", "Hello world"); printf("0x%p\n", "There!"); return 0; }
I might be wrong.
Quoted more than 1000 times (I hope).Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
EDIT: Thanks guys, if I'll have other questions I'll ask.
I hope you understand that the above code prints the contents of the string and not its address. It's the same as for any pointer. Use %p to print the address, and use %s to print the contents of a string.I'm pretty sure that constant strings are located in a static location in the stack and don't have an address.Code:const char *str = "Hello world!"; printf("%s", str); // output: Hello World and not str's address.
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^