Lecture 35 Bit Fields in C Language

  Рет қаралды 105,119

MySirG.com

MySirG.com

Күн бұрын

Пікірлер: 141
@AspirantTD-warrior
@AspirantTD-warrior Ай бұрын
8 years later, it's still the best and easiest explanation available on KZbin 😊
@maheshnandade4334
@maheshnandade4334 7 жыл бұрын
EK BAAT AAPNE SAABIT KARDEE ,KI LECTURES AGAR SAMAJH MEIN AAYE TOH WOH KITNE DILCHASP HOTE HAIN👏👏👏👏👌👍
@softmedun6794
@softmedun6794 Жыл бұрын
👉Sir aap bahut acha padhate hai aisa mere college ke teacher v nhi padhate sir m aapka pura video dekhta hu jo ki mujhe bahut kuchh sikhno ko milta hai Tnk u so much sir 🙏🙏🙏
@ameydhimte_c5956
@ameydhimte_c5956 2 жыл бұрын
At the time this video was released vs code didn't even exist... This fact just makes me think that even today this video is being useful to people...so thankful to u sir
@fantasyteacher
@fantasyteacher Жыл бұрын
Vs Code was released on November 18, 2015
@AspirantTD-warrior
@AspirantTD-warrior Ай бұрын
Amazingly explained sir, cleared my doubts 😊 thank you
@yogarishi649
@yogarishi649 8 жыл бұрын
sir , we luv u ... the most ,the most ...and ........The mostest of the most.(for ur job## hatsoff sir ). always keep uploading videos of all your skills that are necessary for us and for ur hardwork ,we promise to not let it go vain .(one more thing ) --- may u achive immortality.......
@aniketsharma1465
@aniketsharma1465 6 жыл бұрын
UpsteamColors
@devanshgoel3433
@devanshgoel3433 2 жыл бұрын
Sir, you are real legend of computer science.
@nancygautam1312
@nancygautam1312 3 жыл бұрын
Sir apka samjhane ka tareeka i really apricots ur work if every educating system for teachers like you in no time India represent on a different level
@mr.hacker....6266
@mr.hacker....6266 2 жыл бұрын
Thanku SO MUCH,Sir....🤗 You Provide QUALITY EDUCATION for STUDENTS...👌👍👩‍💻
@AnjaliSharma-lk1gn
@AnjaliSharma-lk1gn 4 жыл бұрын
Nd ur lectures are helping us in 2020 alsoo...a bigg thnk-you sirr!!!!!....
@dmohan9878
@dmohan9878 3 жыл бұрын
Can you be my friend?
@dineshjoshi6936
@dineshjoshi6936 7 жыл бұрын
hi sir. I couldn't understand using of unsigned with int.
@sagarbhatt9244
@sagarbhatt9244 5 жыл бұрын
Unsigned means it doesn't contain negative value
@lonewolfmohit
@lonewolfmohit 4 жыл бұрын
@@sagarbhatt9244 thank you bro!🤗
@RahulKumar-wu1cm
@RahulKumar-wu1cm 4 жыл бұрын
Awesome lecture way of instructing is very goo5
@nsumanth18
@nsumanth18 6 жыл бұрын
Awesome explanation....I love u
@priyankaranawat604
@priyankaranawat604 5 жыл бұрын
Does clear all doubts without fail. Really liked it .I look forward for more such useful content videos.
@dmohan9878
@dmohan9878 3 жыл бұрын
Can you be my friend?
@abhishekdash6678
@abhishekdash6678 9 жыл бұрын
sir, i have a doubt.. even in c language we can deal with divide by zero error by using goto() , where the control will move to the lebel back for taking input if the denominator is zero. so can we call it exception handling ?
@dhrumilsinhrajput99
@dhrumilsinhrajput99 9 жыл бұрын
cool videos always
@abhishekm1903
@abhishekm1903 3 жыл бұрын
Excellent work
@shubhameditz1826
@shubhameditz1826 6 жыл бұрын
sir, can you make a video on structure padding also.
@karthikk9422
@karthikk9422 9 жыл бұрын
Aap great hi
@dhruvvbatra9235
@dhruvvbatra9235 4 жыл бұрын
in your example when you assinged bits to d and m the whole of it will be readed in only 1 cycle or 2 cycle
@anilsharma-cd2hq
@anilsharma-cd2hq 6 жыл бұрын
Sir kya hum bit field ka use only structure m hi kar sakte h. local variable m nhi?
@jainayush650
@jainayush650 6 жыл бұрын
Great Explaination :)
@devashishranjan8596
@devashishranjan8596 7 жыл бұрын
thanku sir...nice explanation
@saurabhpola865
@saurabhpola865 4 жыл бұрын
Definitely a worth 👍
@vijayrathore8401
@vijayrathore8401 8 жыл бұрын
sir in Turbo c compiler... struct Date {int d:2; int m:3; int y; }; void main () {struct Date d1={1,1,2016}; printf("%d",sizeof(d1)); getch(); } output iska 2 ke multiple aana chahiye but sir iska output 3 kyo aa raha hai??????
@hamdanali631
@hamdanali631 7 жыл бұрын
mere hisab se toh 4 bytes aana chahiye 3 toh ni yaar
@mr.knight8967
@mr.knight8967 3 жыл бұрын
May be your compiler take 1 bytes for int
@dhananjayverma9826
@dhananjayverma9826 9 жыл бұрын
thanks a lot sir!
@Aditya-dv5wg
@Aditya-dv5wg 4 жыл бұрын
Thanks sir for this vedio 🙏
@EveryType883
@EveryType883 Жыл бұрын
Thank you very much sir..
@billi5047
@billi5047 4 жыл бұрын
Sir, user enter a number how can identify the bits are required in program
@nsumanth18
@nsumanth18 6 жыл бұрын
So are very good
@chandandas2041
@chandandas2041 3 жыл бұрын
Awesome
@motivatedindia-thelion2816
@motivatedindia-thelion2816 4 жыл бұрын
Excellent sirG
@stark_n
@stark_n 6 жыл бұрын
Sir I made a program yesterday by using struct and there are char,int data type .But when I set the bit field I had to set max value of bit plus one.i.e when the bit field was 5 for int 30; but Ihad to use 6..why sir?plz give an answer
@codeWithMe199
@codeWithMe199 4 жыл бұрын
love from Bangladesh
@shubhamdubey7598
@shubhamdubey7598 7 жыл бұрын
error in taking value from user its says i am giving address of bit fields,,so,cant we give address of bit fields? pls explain.
@abcd76820
@abcd76820 5 жыл бұрын
unsigned kis liye likh rhe hai? structure k andr
@anuragvikasmishra7799
@anuragvikasmishra7799 8 жыл бұрын
Hi, I am following this series of videos from the beginning, and I definitely like them. I am not sure that what is this unsigned type. could you please explain that what is the use of this keyword 'unsigned' , and how it will affect the program if I do not use this.
@anuragvikasmishra7799
@anuragvikasmishra7799 8 жыл бұрын
I am still unable to understand the concept. why it is necessary to use that , and what will happen if I do not write this keyword. Can you suggest any video where you have explained about it. If yes, that would be a great help in understanding this concept.
@KerzDude
@KerzDude 8 жыл бұрын
in a signed integer, the left most bit is reserved for the sign. 0 = positive, 1 = negative. So lets say we have a signed integer that is 3 bits. 000 = 0 001 = 1 010 = 2 011 = 3 100 = -4 (due to two's compliment) 101 = -3 (due to two's compliment) 110 = -2 (due to two's compliment) 111 = -1 (due to two's compliment) so the range of a 3 bit signed integer is from -4 to 3. in an unsigned integer, the left most bit is used for the actual number. 000 = 0 001 = 1 010 = 2 011 = 3 100 = 4 101 = 5 110 = 6 111 = 7 so the range of a 3 bit unsigned integer is from 0 to 7. Use signed integers if you want to have negative values, otherwise use unsigned. If you're wondering what two's compliment is, it's how the computer represents signed integers. Say you have a signed integer represented in binary like : 1001. Since the leftmost 1 means negative, to determine what number this value is a negative of, the computer flips all of the bits: 1001 -> 0110, and then adds 1: 0110 -> 0111, which is 7. So 1001 is actually -7 in a 4 bit signed integer. Hope that helps.
@gauravbaviskar4778
@gauravbaviskar4778 7 жыл бұрын
Michael Kerzman Thanks
@ravidesai650
@ravidesai650 9 жыл бұрын
sir or videos kab aayege ???
@RakeshSingh-fy6us
@RakeshSingh-fy6us 4 жыл бұрын
Sir please explain the topic structure padding
@salonirathi1158
@salonirathi1158 6 жыл бұрын
Nice video:))
@dmohan9878
@dmohan9878 3 жыл бұрын
Can you be my friend!?
@kajalgupta2160
@kajalgupta2160 5 жыл бұрын
Nice explanation
@kuldeepsharma7499
@kuldeepsharma7499 5 жыл бұрын
Sir suppose d 17 bits consume krra h or m 16 bits so 3rd chunk bhi use hoga right so d,m,y ka size 12bytes hoga rightes? But kya code optimise hoga? Ya jo memory Bina bit field use hori h vhi hogi? Kya unused bits 0 hojegi ya koi or variable use kr Sakti h?
@farzanalam1587
@farzanalam1587 4 жыл бұрын
Sir 4-4 bytes krke to mil hi rha h hume..to faeda kahan hua?? Use ni kr rhe h hm poora 4 bytes but mili to hui h na hume..to wastage ni hui?
@abhinavojha1204
@abhinavojha1204 8 жыл бұрын
sir can you tell me how does bit field can be applied on a float data-type?
@shubhpandey5228
@shubhpandey5228 8 жыл бұрын
Abhinav Ojha same way bro ..
@pravinbadgujar7228
@pravinbadgujar7228 6 жыл бұрын
Why we are used unsigned int not only int? What happen when we will use only int?
@AnimsQuest
@AnimsQuest 7 жыл бұрын
It means the rest bit unused and its the drawback of bitfield.
@abhishekmaurya1170
@abhishekmaurya1170 5 жыл бұрын
मुझे ये नहीं समझ आया कि हमने getch function ya fclose use nhi kiya to output kasa dikh RHA h isme
@yogeshrawat1204
@yogeshrawat1204 5 жыл бұрын
Bhai fclose sirf tb use hota hai jb hum file ke saath kaam kr rhe hote hai... Yha hun simple sa ek concept dekha rhe hai✌
@akashpant8209
@akashpant8209 4 жыл бұрын
Babu codeblocks m getch() ki requirement ni hoti Turbo C par hoti h.
@diamondstar939
@diamondstar939 4 жыл бұрын
I like it
@AlokGuptakumar
@AlokGuptakumar 6 жыл бұрын
very good
@sambhavsharma9661
@sambhavsharma9661 8 жыл бұрын
Sir, int ki hi value kiu different hoti ha different OS while others(float, char,double) contain same value. why? its urgent Sir.
@shubhpandey5228
@shubhpandey5228 8 жыл бұрын
Sambhav Sharma no brother ... sabhi ki value different hoti ... sizeof ka use krke tum value print ..krke dkh skte ho kitni memory le rhi
@saiyadimran8429
@saiyadimran8429 7 жыл бұрын
hi sir how to reduce whole creatred in after field
@saddamhusain-ls5qr
@saddamhusain-ls5qr 7 жыл бұрын
thanks to you sir
@mohdtauheedkhan7035
@mohdtauheedkhan7035 6 жыл бұрын
sir what we can use bit field without using unsigned keyword ????
@anshikabansal5642
@anshikabansal5642 3 жыл бұрын
Sir.. Is it not possible to take the values of bit field by the user using scanf().. It shows me error.
@dmohan9878
@dmohan9878 3 жыл бұрын
Can you be my friend?
@ketangulhane1631
@ketangulhane1631 5 жыл бұрын
Sir structure padding pe video banayi ye.
@crazymind6488
@crazymind6488 4 жыл бұрын
if data type is different then bit field is work or not?
@mdirshadalam2617
@mdirshadalam2617 5 жыл бұрын
Sir, how will locate 16 bytes in bit field in c++?
@sohitkumar7215
@sohitkumar7215 4 жыл бұрын
sir i am sohit or hamko bit fields me problam ho raha he plese help me sir
@shankaranand9129
@shankaranand9129 4 жыл бұрын
Structure padding concept is applied
@kartikwadhawan7448
@kartikwadhawan7448 6 жыл бұрын
Why did we write unsigned before the int
@ushniksarkar6123
@ushniksarkar6123 6 жыл бұрын
Sir what if mixed type variables are used in the structure, like int char float ? So how the allotment in multiples of 4bytes changes or it remains the same ?
@GauravSharma-ce1yb
@GauravSharma-ce1yb 3 жыл бұрын
I also want ask the same question If you got answer then tell me also..?
@PP-hs5sg
@PP-hs5sg 6 жыл бұрын
what if we use 64 bit software
@pawandev1876
@pawandev1876 3 жыл бұрын
❤️❤️
@deepakbhatt1099
@deepakbhatt1099 5 жыл бұрын
How to use the left space(bits) ?
@vsh155
@vsh155 5 жыл бұрын
😋😋😋👌🤘👌🤘
@shayankhan4249
@shayankhan4249 3 жыл бұрын
Nice
@pahadikudi3415
@pahadikudi3415 6 жыл бұрын
Sr u said that if we need 33 bits for dates and moths then 8 bytes will be allocated...Then plzz tell me fr year 4 bytes will be allocated r 8 bytes
@dmohan9878
@dmohan9878 3 жыл бұрын
Can you be my friend?
@besuccessful1226
@besuccessful1226 7 жыл бұрын
sir unsigned kis liye use krte h
@dharmendrahc1985
@dharmendrahc1985 5 жыл бұрын
If we learned C, can we make an application, like using .Net, JAVA sir.
@anjuagarwal2040
@anjuagarwal2040 6 жыл бұрын
Sir please make atleast one more video of this lecture on bit fields
@dmohan9878
@dmohan9878 3 жыл бұрын
Can you be my friend?
@arpitpundir5309
@arpitpundir5309 6 жыл бұрын
V.gud sir
@aadi8399
@aadi8399 4 жыл бұрын
Sir every value is stored in memory as it's ASCII equivalent So how does this bit field works
@awaizkhan1333
@awaizkhan1333 4 жыл бұрын
Bro ASCII codes are used to represent character constants which consume 8 bit or one byte in memory in both 16 and 32 bit compiler. And here bit fields was used to reduce the size of integer constants.
@abhaykumarmodi7365
@abhaykumarmodi7365 4 жыл бұрын
ASCII value is for our understanding, memory always allocated in bits or bytes format and Bit fields works on bits
@aadi8399
@aadi8399 4 жыл бұрын
Sir actually my dout is If we store 1 then it will stored as its ASCII equivalent that is 49 it means it takes 6 bits to store
@VinodPatel-tn1hf
@VinodPatel-tn1hf 8 жыл бұрын
sir g which os should i use for coding ?
@lovemyindia8225
@lovemyindia8225 7 жыл бұрын
sir command line argument se file handling copy karna batayee c lang me
@GauravSharma-ce1yb
@GauravSharma-ce1yb 3 жыл бұрын
Sir hme 4-4 bytes ke multiple mein hi ku memory blocks milenge
@bmanichander8446
@bmanichander8446 3 жыл бұрын
No it isn't like that as sir used unsigned int and it is a 32 bit compiler so 4-bytes ke multiple me ayega if u use float in 32-bit 8-bytes ke multiple me ayega Simply... sizeof(datatype) ke multiple
@balajicharan2481
@balajicharan2481 8 жыл бұрын
how to implement bitwise operator for addition (any arithmetic operators) in c
@shubhpandey5228
@shubhpandey5228 8 жыл бұрын
Balaji Charan.. bitwise operators ka ek alg se chapter h ..isi channel pe.. use dkho ..
@statusguru5251
@statusguru5251 6 жыл бұрын
Can we use short int
@more_tusharr
@more_tusharr 6 жыл бұрын
Sir what is Padding in C?
@akashddeepchitransh4537
@akashddeepchitransh4537 4 жыл бұрын
Sir what is that unsigned keyword
@aparnasamantaray4935
@aparnasamantaray4935 5 жыл бұрын
Why it uses 8 bytes of memory where 41bits
@user-882hhgys
@user-882hhgys 7 жыл бұрын
main{ int a; printf("%d",a); } output me 2 kyu aa RHA h garbage value h kya
@anilsharma-cd2hq
@anilsharma-cd2hq 6 жыл бұрын
bhai turbo compiler m Int block 2 byte ka hi hota h
@ritikadhangar2979
@ritikadhangar2979 4 жыл бұрын
Ye garbage value h
@harpuneetkalsi5960
@harpuneetkalsi5960 4 жыл бұрын
hi sir , can bit fields only be used with unsigned??
@bmanichander8446
@bmanichander8446 3 жыл бұрын
No it can be used with other datatypes also
@shaguftajamal2992
@shaguftajamal2992 6 жыл бұрын
sir how can i bought python video reply me ASAP
@mlgquickscoper8122
@mlgquickscoper8122 7 жыл бұрын
aree sir fullscreen upload kiya karo ye 4:3 aspect ratio annoying hai
@fahimsanghariyat162
@fahimsanghariyat162 7 жыл бұрын
unsigned fuction use????????????
@aniketsharma6221
@aniketsharma6221 7 жыл бұрын
Sir Bit field not working in ubuntu plz help........
@surajjadhav2829
@surajjadhav2829 4 жыл бұрын
thank you
@manishraj7455
@manishraj7455 8 жыл бұрын
Sir,Kya ham bache hue bits ka use kar sakte h Kya???
@techsapmadeeasy
@techsapmadeeasy 6 жыл бұрын
no
@samadakbarzai8135
@samadakbarzai8135 5 жыл бұрын
please tell me sir a way that i can tell you my problems because you dont answer comments
@starshirts3616
@starshirts3616 4 жыл бұрын
sir aapne year explian nahi kiya
@bhawika902
@bhawika902 6 жыл бұрын
cant we declare date 22 /1/16 in beginning only why have u declared it two times
@dmohan9878
@dmohan9878 3 жыл бұрын
Can you be my friend?
@jayeshpatilcj7911
@jayeshpatilcj7911 4 жыл бұрын
Sir I don't understand the signed and unsigned please make video on it
@bmanichander8446
@bmanichander8446 3 жыл бұрын
Signed means both negative and positive combined like if u take signed int then you can assign both negative integers and positive integers to that signed variable If u take unsigned int then u will have to assign only positive integers to that variable.
@jayeshpatilcj7911
@jayeshpatilcj7911 3 жыл бұрын
@@bmanichander8446 ok Thank you ☺️
@aamirsohail1241
@aamirsohail1241 7 жыл бұрын
Can anyone please help me out with this program? write a C function to set "n" bits in a 32-bit number "X" starting from position "p" It should be something like, int set_n_bits(int X, int n, int p)
@pramanikamitkumar
@pramanikamitkumar 7 жыл бұрын
use bitwise operator like right & left shift (>)
@amitkhandelwal6866
@amitkhandelwal6866 5 жыл бұрын
Sir bitfields samajh nhi aaya
@besttimeofthisplanet4234
@besttimeofthisplanet4234 6 жыл бұрын
Thanks
@Sahilbc-wj8qk
@Sahilbc-wj8qk 6 жыл бұрын
UNION IS ALSO A GOOD WAY I THINK
@VanshitShah-ji3xh
@VanshitShah-ji3xh Жыл бұрын
sir ap mjo ytube channel chalate hoooooo 😂😂😂😂
@sagarkoli2199
@sagarkoli2199 5 жыл бұрын
Why here use unsigned
@anitakumawat8103
@anitakumawat8103 6 жыл бұрын
unsigned kyu likha h aage
@dmohan9878
@dmohan9878 3 жыл бұрын
Can you be my friend?
@saurabhsharma8014
@saurabhsharma8014 8 жыл бұрын
#include using namespace std; struct student { int roll; char name; int dob; }s; int main() { cout
@uditkaushik
@uditkaushik 7 жыл бұрын
+Saurabh sharma see,first select that data type whose size is maximum (in your case it's 'int' because char is 1 byte) . Now assign each data type memory or blocks according to the size of that data type. i.e 4 bytes for int + 4 bytes to represent char + 4 bytes to represent dob = 12 bytes. To make it more clear to you let's take another example... suppose instead of int roll, there would have been long int roll..in that case it would have maximum size i.e 8 bytes hence the assignment of bytes in that case would be 8 bytes + 8 bytes + 8 bytes = 24 bytes. I hope it would be clear to you .
@saurabhsharma8014
@saurabhsharma8014 7 жыл бұрын
thanx Bhai
@pramanikamitkumar
@pramanikamitkumar 7 жыл бұрын
int roll will take 4 bytes, char name will take 1 byte but remain 3 bytes will remain vacant, as next data will store in new memory location so it will leave 3 bytes extra.
Lecture 36 Command Line Arguments in C language Hindi
35:20
MySirG.com
Рет қаралды 181 М.
What is NULL Pointer in C Language Hindi
8:59
MySirG.com
Рет қаралды 96 М.
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
C_114 Unions in C | C Language Tutorials
17:19
Jenny's Lectures CS IT
Рет қаралды 182 М.
Lecture 25 Writing in a file in C Language Hindi
21:52
MySirG.com
Рет қаралды 224 М.
C PROGRAMMING | Part-20 | Bitfields
10:10
Engineering Drive
Рет қаралды 17 М.
#15  C Functions | C Programming for Beginners
16:57
Programiz
Рет қаралды 248 М.
I Helped 2,000 People Walk Again
15:31
MrBeast
Рет қаралды 26 МЛН
Lecture 28 Reading from file using fgets in C Language Hindi
12:40
Full Computer Science Degree in a Nutshell
20:39
MrAlgorithm
Рет қаралды 111 М.
What is Wild Pointer in C Language Hindi
16:28
MySirG.com
Рет қаралды 97 М.
Structure Padding in C
8:42
Neso Academy
Рет қаралды 255 М.
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН