Code 1 OUTPUT: 6Code:#include <iostream> //CODE 1 using namespace std; int main() { char c[]="Hello"; //C-style string cout<<sizeof(c); return 0; }
Code 2 OUTPUT: 8Code:#include <iostream> // Code 2 using namespace std; int main() { char *c="Hello"; //C-style string cout<<sizeof(c); return 0; }
Why there is discrepancy between the two?