C data types 📊

preview_player
Показать описание
C data types tutorial example explained

#C #data #types

char a = 'C'; // single character %c
char b[] = "Bro"; // array of characters %s

float c = 3.141592; // 4 bytes (32 bits of precision) 6 - 7 digits %f
double d = 3.141592653589793; // 8 bytes (64 bits of precision) 15 - 16 digits %lf

bool e = true; // 1 byte (true or false) %d

char f = 120; // 1 byte (-128 to +127) %d or %c
unsigned char g = 255; // 1 byte (0 to +255) %d or %c

short h = 32767; // 2 bytes (−32,768 to +32,767) %d
unsigned short i = 65535; // 2 bytes (0 to +65,535) %d

int j = 2147483647; // 4 bytes (-2,147,483,648 to +2,147,483,647) %d
unsigned int k = 4294967295; // 4 bytes (0 to +4,294,967,295) %u

long long int l = 9223372036854775807; // 8 bytes (-9 quintillion to +9 quintillion) %lld
unsigned long long int m = 18446744073709551615U; // 8 bytes (0 to +18 quintillion) %llu

printf("%c\n", a); // char
printf("%s\n", b); // character array
printf("%f\n", c); // float
printf("%lf\n", d); // double
printf("%d\n", e); // bool
printf("%d\n", f); // char as numeric value
printf("%d\n", g); // unsigned char as numeric value
printf("%d\n", h); // short
printf("%d\n", i); // unsigned short
printf("%d\n", j); // int
printf("%u\n", k); // unsigned int
printf("%lld\n", l); // long long int
printf("%llu\n", m); // unsigned long long int
Рекомендации по теме
Комментарии
Автор

#include <stdio.h>
#include <stdbool.h>

int main(){

char a = 'C'; // single character %c
char b[] = "Bro"; // array of characters %s

float c = 3.141592; // 4 bytes (32 bits of precision) 6 - 7 digits %f
double d = 3.141592653589793; // 8 bytes (64 bits of precision) 15 - 16 digits %lf

bool e = true; // 1 byte (true or false) %d

char f = 120; // 1 byte (-128 to +127) %d or %c
unsigned char g = 255; // 1 byte (0 to +255) %d or %c

short h = 32767; // 2 bytes (−32, 768 to +32, 767) %d
unsigned short i = 65535; // 2 bytes (0 to +65, 535) %d

int j = 2147483647; // 4 bytes (-2, 147, 483, 648 to +2, 147, 483, 647) %d
unsigned int k = 4294967295; // 4 bytes (0 to +4, 294, 967, 295) %u

long long int l = 9223372036854775807; // 8 bytes (-9 quintillion to +9 quintillion) %lld
unsigned long long int m = 18446744073709551615U; // 8 bytes (0 to +18 quintillion) %llu

printf("%c\n", a); // char
printf("%s\n", b); // character array
printf("%f\n", c); // float
printf("%lf\n", d); // double
printf("%d\n", e); // bool
printf("%d\n", f); // char as numeric value
printf("%d\n", g); // unsigned char as numeric value
printf("%d\n", h); // short
printf("%d\n", i); // unsigned short
printf("%d\n", j); // int
printf("%u\n", k); // unsigned int
printf("%lld\n", l); // long long int
printf("%llu\n", m); // unsigned long long int

return 0;
}

BroCodez
Автор

Wow! This is impressive, you covered a lot with explicit explanation within few mins...Thank you sir.

jeedhy
Автор

brother you content is my new go to source for information on any coding questions i have, as a newbie they really help out a "long long int" haha

chadmurray
Автор

youre the best i want to start game designing but i didnt find any free tutorials so thank you soo much

المؤتمر
Автор

C is actually my favorite programming language

nizarouertani
Автор

Welcome back Bro. Thanks for another great video.

HadesTimer
Автор

Concise and comprehensive explanation. Thanks a ton.

annoyingprecision
Автор

<*_> This is my seal. I have watched the entire video, understood it, and I can explain it in my own words, thus I have gained knowledge. This is my seal. <_*>

piotrmazgaj
Автор

Mr Bro thanks for your time, I just wanna told that you have a good explanation way m

amr.h
Автор

Yis pls, more C stuff. Thank you very much. Good Stuff C is.

smau
Автор

What are the most common type ppl usually use?
I found out, its int, char, short, long, bool and unsigned

ihevdabestgaminchair
Автор

Dude this vídeo is just amazing, thanks!!!

GOLDN
Автор

long long data type, ensures that it can accommodate the full range of memory addresses on the target system.

kualasaleem
Автор

the video is helpful, but I need the link to the last video please ❤

MariemSaadouli