KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Are both these codes the same char ch = 'a'; printf("%d", ch); Will it print a garbage value? I am confused about this printf("%d", '\0'); Will this print 0 or garbage value? Because when i do this printf("%d", sizeof('\n')); It prints 4. Why is sizeof('\n') 4 bytes? The same thing in C++ prints 1 bytes. Why is that? So here's the main question in c language is printf("%d", '\0') supposed to print 0 and in C++ printf("%d", '\0') supposed to print garbage?
Tags (comma-separated)
Save Edits
Cancel