What's the Difference Between " " and ' ' in C Programming [Duplicate]

Can anybody explain the difference between " " and ' ' in c programming? its getting to mi example:

if i use ' '

date=type=='a';
if (date)
{
printf("its a date");
printf("%d",date);
}

it prints 1 and if i use " "

date=type=="a";
if (date)
{
printf("its a date");
printf("%d",date);
}

it prints 0

2

Double quotes is for string and single quotes for character. But since you are using character in both of your samples then it doesnt make any difference. You can store character using double quotes but not the vice versa

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest