I want to print the following in C.
Tonight’s schedule is:
• Pizza
• Movie
• ice cream
I do not know how to print the bullet point character.
I want to print the following in C.
Tonight’s schedule is:
• Pizza
• Movie
• ice cream
I do not know how to print the bullet point character.
The code bellow can give you guide on this:
#include <stdio.h>
int main(int argc, char** argv)
{
printf("Tonight’s schedule is: \u2022 Pizza \u2022 Movie \u2022 ice cream\n");
return 0;
}
• search for html number •
This link declares "\u2022" as the C source code encoding.
You can simply do this:-
puts("Tonight’s schedule is: • Pizza • Movie • ice cream");
You can do it using Extended ASCII values.If you run your program in cmd, sometimes this will not work. because your cmd code page doesn't support for those ASCII values. paste this code in to the codechef online ide(https://www.codechef.com/ide) and run it and see the out put. This is a working solution.
#include <iostream>
using namespace std;
#include<stdio.h>
int main(){
char list1[]="Pizza";
char list2[]="Movie";
char list3[]="ice cream";
int a=149;
printf("%c %s %c %s %c %s",a,list1,a,list2,a,list3);
}
it depends on the terminal where you want the characters to be shown. Send the characters according to the enconding of this terminal. For example, it is different for MS-windows (using, for example windows 1252) or linux (using, for example utf-8).
This is the conversion of ascii to character.
#include<stdio.h>
void main(){
char a=atoi("149");
printf("%c %s %c %s %c %s",a,"pizza",a,"movie",a,"ice cream");
}