Ok,
I'm trying to learn the basics of C here. What have I misunderstood about pointers, as I thought this would work:
[tt]
#include "stdafx.h"
void main()
{
char* duh = "Foo";
printf("%s", *duh);
}
[/tt]
printf("%s", duh); works fine. Why? Shouldn't it print out the memory address?
(the only stupid question is the one that is not asked =))
I'm trying to learn the basics of C here. What have I misunderstood about pointers, as I thought this would work:
[tt]
#include "stdafx.h"
void main()
{
char* duh = "Foo";
printf("%s", *duh);
}
[/tt]
printf("%s", duh); works fine. Why? Shouldn't it print out the memory address?
(the only stupid question is the one that is not asked =))