char print c code example
Example 1: print in c
printf("Hello World");
Example 2: c print sizeof char
char b = 'b';
printf("the size of b is %d",sizeof(b));
Example 3: printf in c
#include <stdio.h>
int printf(const char *format, ...);
int main(void)
{
int nb = 20;
printf("Hello World !\n");
printf("%d\n", nb);
printf("%s/%d\n", "Nice", 20);
return (0);
}
Example 4: printf n characters c
const char * mystr = "This string is definitely longer than what we want to print.";
printf("Here are first 5 chars only: %.5s\n", mystr);