Here is the output:
sizeof test_ptr = 4
sizeof(test_ptr) = 4
sizeof test_ptr = 4
sizeof(test_ptr) = 4
sizeof test_ptr2 = 33
sizeof(test_ptr2) = 33
My question is: After test_ptr has been malloc'ed, why doesn't the sizeof report a size of 17? When I staticly allocated memory for test_ptr2, it has the output I expect.
From my understanding of C, when an array is initialized as char * array or char array[], it is the same thing. What am I missing?
sizeof test_ptr = 4
sizeof(test_ptr) = 4
sizeof test_ptr = 4
sizeof(test_ptr) = 4
sizeof test_ptr2 = 33
sizeof(test_ptr2) = 33
My question is: After test_ptr has been malloc'ed, why doesn't the sizeof report a size of 17? When I staticly allocated memory for test_ptr2, it has the output I expect.
From my understanding of C, when an array is initialized as char * array or char array[], it is the same thing. What am I missing?
