3 ms·
> char *stackString = "some literal"; Uh, in what way is that "entirely different" from the int declaration? In both cases, you're just copying a couple words
by theseoafs 13y ago
> char *stackString = "some literal";
Uh, in what way is that "entirely different" from the int declaration? In both cases, you're just copying a couple words from one place to another, which is what the = operator does. There's nothing "special" about that declaration; we're just writing a pointer into a variable on the stack.
My feeling is that you're uncomfortable with C's treatment of strings because you don't entirely understand the memory model.
- i_c_b 13y agoGiven what you've written, I have my own doubts about your understanding too. Unfortunately, that and your proactive psychoanalysis of me are not interesting conversation topics.
- theseoafs 13y agoWell, you could help out my ignorance by explaining what's so special about `char *s = "some string";`.