452 views
0 votes
0 votes

https://gatecse.in/data_types_operators_in_c/ Q7. 

 

#include <stdio.h>

int main()

{

    char *p = "Hello World";

    char q[] = "Hello World";

    printf("%zd %zd", sizeof p, sizeof *p);

    printf("\n");

    printf("%zd %zd", sizeof q, sizeof *q);

    return 0;

}

sizeof p- size of pointer which is compiler dependent

sizeof q-size of the char array

Is it correct? What will sizeof *p and sizeof *q give?

I am getting the output as 

4 1

12 1

 

Please log in or register to answer this question.

Related questions

0 votes
0 votes
0 answers
1
0 votes
0 votes
1 answer
3
sidjha57 asked Jan 18, 2022
465 views
Why am I not able to access the course content that is to enroll in the courses on go classroom?It says that it has been ended on 21st July is there any other way to acce...
0 votes
0 votes
0 answers
4
sakharam asked Oct 17, 2018
236 views
What is Squareroot(L) and Square(L)?