Char datatype in C-language

Last updated:9/22/2020 6:26:27 AM

1 Answers

Prakash nidhi Verma
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;

Answer