Home / DeveloperSection / Interviews / Char datatype in C-language
You haven’t finished your post yet. Are you sure you want to leave and discard your draft?
Can you answer this question?
Prakash nidhi Verma
Char datatype in c language:
The memory allocated to a character variable is 1 byte while memory allocated to character constant is 4 byte because it returns ASCII value.
#include<stdio.h> int main() { char s='a'; printf("%d",(int)sizeof(s)); printf("%d",(int)sizeof('a')); return 0;}
char ch1 = 'a'; char ch2 = ch1;
You have need login or register for voting of answers or question.
Prakash nidhi Verma
10-Jul-2018Char datatype in c language:
The memory allocated to a character variable is 1 byte while memory allocated to character constant is 4 byte because it returns ASCII value.