What does sizeof (char *) do?
I was reading C ++ Primer and this piece of code came up and I was wondering what sizeof (char *) does and why is it so significant?
char *words[] = {"stately", "plump", "buck", "mulligan"};
// calculate how many elements in words
size_t words_size = sizeof(words)/sizeof(char *);
// use entire array to initialize words2
list<string> words2(words, words + words_size);
Thanks in advance.
+2
source to share
2 answers