Skip to main content

Thread: a char is i byte and int is 4 byte then how does char a='Z' work


i not clear simple situation

code:
char a='z';
that use assign z a.
question

code:
sizeof(a) gives 1
and z integer value 4 bytes.then how can

code:
char (1 byte)='z'(4 bytes)
statement works.
code:
#include<stdio.h>  int main (){  char c='a'; printf("%d %d", sizeof(c),sizeof('a')); }
the above code give output
code:
1 4

i'm kind of new programming... doesn't character variable act pointer address of data is? perhaps explaination... i'm not sure... in case i'm wrong or plain stupid i'm ready whiplash


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk a char is i byte and int is 4 byte then how does char a='Z' work


Ubuntu

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support