C Programming - Strings - Discussion

Discussion Forum : Strings - Find Output of Program (Q.No. 17)
17.
If the size of pointer is 32 bits What will be the output of the program ?
#include<stdio.h>

int main()
{
    char a[] = "Visual C++";
    char *b = "Visual C++";
    printf("%d, %d\n", sizeof(a), sizeof(b));
    printf("%d, %d", sizeof(*a), sizeof(*b));
    return 0;
}
10, 2
2, 2
10, 4
1, 2
11, 4
1, 1
12, 2
2, 2
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
30 comments Page 3 of 3.

Gurchet said:   1 decade ago
@Sonu.

We don't include null in size of string.

Akash said:   9 years ago
You guys are explained superbly. Thank you!

Shital said:   9 years ago
Thank you guys. I understand completely!

Shehnaz said:   8 years ago
Thanks for the given description.

Chaitanya said:   1 decade ago
Thank you. Yogesh garu.

Ziad said:   8 years ago
It's 10 with escape.

Rockz said:   10 years ago
I didn't get this!

Ankith said:   3 years ago
Thank you @Pranay.
(1)

Jeetu said:   5 years ago
Thanks all.

Sivaram bvrice said:   1 decade ago
Thank you.


Post your comments here:

Your comments will be displayed after verification.