Buckys C++ Programming Tutorials - 40 - sizeof

  Рет қаралды 345,160

thenewboston

thenewboston

Күн бұрын

Пікірлер: 222
@peachyspalace
@peachyspalace 8 жыл бұрын
Last video: "Sorry guys but the next video we are going to be talking more about pointers, were not done with them yet!" This video: "Okay so were going to take a quick break from pointers" xD
@gunnerjaxen5651
@gunnerjaxen5651 3 жыл бұрын
Instablaster
@LosEagle
@LosEagle 12 жыл бұрын
With Bucky's tutorials you don't even need to study programming in school this is like 100 times better than listening teachers explanations. Our teacher always teach me like 50% of what I learn from Bucky's tutorials.
@LM-bg7iv
@LM-bg7iv 5 жыл бұрын
thank you bucky, I´m learning more from your youtube tutorials then from my college professor, really appreciate it, I watch all your adds :P
@liamtzinch5225
@liamtzinch5225 11 жыл бұрын
I speak russian, but it doesn't matter , He explains better than any russian blogers Спасибо большое!!! Теперь сдам пару на 5
@blade55555
@blade55555 12 жыл бұрын
He was saying what most programmers might think when starting off that they shouldn't care, he is saying you should and will care.
@510bankai
@510bankai 7 жыл бұрын
It's amazing how simple and easy to understand you make it! Great job man!
@Jack-4242
@Jack-4242 13 жыл бұрын
i just calculated that integers can store values up to 4,294,967,296. if you enter higher numbers, the variable starts to count from 1 again. so int c = 4294967297 cout
@stevevolkmen2676
@stevevolkmen2676 12 жыл бұрын
I remember in 1992 when I took C++ and it seemed so hard to learn. The Teacher rushed us to biuld projects I was not ready for. I went into the field of electronics and avoided learning code. I like to thank Bucky for makeing this easier to learn, I wish I had this back then.
@stevensadhwani1761
@stevensadhwani1761 10 жыл бұрын
Your tutorials are so helpful. THANK YOU
@xXBR4D3NXx
@xXBR4D3NXx 12 жыл бұрын
cout
@thefremddingeguy6058
@thefremddingeguy6058 8 жыл бұрын
You received 4 for your integer because, all integers in a 32-bit computer are stored as 32 ones and zeros. Eight of those ones or zeros is a byte, and 32 divided by 8 is 4.
@Aronmathew1
@Aronmathew1 8 жыл бұрын
"ones and zeroes" are bits. And yes eight bits make a byte.
@thefremddingeguy6058
@thefremddingeguy6058 8 жыл бұрын
Aron Mathew I know they're called bits. I'm simplifying it.
@09087132
@09087132 8 жыл бұрын
I have a 64 bit computer though and I got 4. Maybe it's because I am running 32bit compiler?
@delavago5379
@delavago5379 8 жыл бұрын
yes that is correct. the compiler bit version also can determin the number out put.
@thefremddingeguy6058
@thefremddingeguy6058 8 жыл бұрын
+Fabio Blanco Dela vago is correct. In most C implementations, whether or not you have a 32-bit or 64-bit, your numbers are based on 32-bit implementations. This is why RAND_MAX is typically 2**31-1 instead of 2**63-1.
@Qazqi
@Qazqi 12 жыл бұрын
Not just that, the array decays into a pointer to the first element and dereferencing that pointer gives you the first element of the array.
@madmenyo
@madmenyo 12 жыл бұрын
Not nitpicking and I know this is old but you can actually do: sizeof(bucky) / sizeof(*bucky) The star returns a single element of the array.
@seatownrocks
@seatownrocks 12 жыл бұрын
great videos... small correction for this one. @2:22 you say "a double is basically a more precise integer". it is a more precise float. hope that helps. keep up the awesome tutorials.
@TheRafelito19
@TheRafelito19 9 жыл бұрын
in order to calculate the number of elements store in a given array it is batter to the fallowing : sizeof (myarray)/sizeof(double) or whatever the data type is.
@antiHUMANDesigns
@antiHUMANDesigns 7 жыл бұрын
"sizeof()" is not a function, it is an operator.
@jeevvv1101
@jeevvv1101 5 жыл бұрын
Look at the year when he posted this he might be comfortable with calling it as a function so you're getting knowledge thats the important thing👍😊Hope you understand this
@gabrielasakanta8013
@gabrielasakanta8013 5 жыл бұрын
This guy is trying to downgrade bucky ahhahahah poor guy
@shikharkapoor8165
@shikharkapoor8165 4 жыл бұрын
@@gabrielasakanta8013 he is right
@theseangle
@theseangle 4 жыл бұрын
@@gabrielasakanta8013 No u. You're so dumb. That guy is smarter than you by 100 times. Just go to one of previous episodes and find his comments. He's telling straight facts and refinements so we won't meet any confuses in future and I am telling thanks to him.
@falcontech6972
@falcontech6972 4 жыл бұрын
Nope.
@siggi1b1svela
@siggi1b1svela 11 жыл бұрын
Yes, they are bytes. You rarely(read never) operate with bits. A byte is the minimum amount of memory that you can reserve on a system. A byte on most(Close to all) systems is now 8bit. The sizeof function most definitely returns the amount of bytes that the variables holds in the memory.
@ChizzKidd
@ChizzKidd 7 жыл бұрын
lol everytime he says "bytes"
@abheetl9743
@abheetl9743 6 жыл бұрын
"boit"
@alanlowe9716
@alanlowe9716 3 жыл бұрын
My head gets done in by the sheer number of times he says "go ahead"... You're not going to be able to unhear it now... :D
@mannyt814
@mannyt814 8 жыл бұрын
WOAH !! thank you so much. I've been going about it the long way using a loop to count the number of elements in an array LOL !. Though I guess its not wrong, this method is way more easier.
@mannyt814
@mannyt814 8 жыл бұрын
This only works for arrays that have been already initialized (meaning it has a ' \0 ' or ' NULL ' at the end of the elements. If the array has not been initialized, then this loop doesn't work, and will display garbage values. : for (int count = 0; bucky[count] != '\0'; count++){ cout
@mannyt814
@mannyt814 8 жыл бұрын
WOAH ! that didn't occur to me. Thanks ! You got another solution? Say like in the case the array is defined as [100], but its only been initialized 20 elements. How would you count the elements?
@anteconfig5391
@anteconfig5391 7 жыл бұрын
no, i think that 0 and "\0" are two different things. the second one has an escape Character in it which would give it another meaning to the compiler.
@divyammaru5476
@divyammaru5476 8 жыл бұрын
I undestood everything. Thanks.
@jvrcb1715
@jvrcb1715 9 жыл бұрын
Another way to get the number of elements from the array regardless of type: varType arr[n] = {...}; int arrLength = sizeof(arr)/sizeof(varType); Example: int arr[3] = {1, 2, 3}; int arrLength = sizeof(arr)/sizeof(int);
@TheRafelito19
@TheRafelito19 9 жыл бұрын
Javier Ceballos just what i thought
@alyagomaa5101
@alyagomaa5101 5 жыл бұрын
thats cool\
@ivandrofly
@ivandrofly 11 жыл бұрын
cout
@LANstorm.
@LANstorm. 5 жыл бұрын
#include int main() { std::cout
@bladedtimes3466
@bladedtimes3466 11 жыл бұрын
It doesn't store it differently, int is 4 bytes explicitly because an integer is int32, 32 bits. a byte is 8 bits. 32/8 = 4. int16, short, is 2 bytes. int64, long, is 8 bytes.
@skyworm8006
@skyworm8006 11 жыл бұрын
This is good. Cause int=8 bytes bool=1 bytes. This is essential when creating a program for commercial distribution. Such as a game, to get the best performance and lowest amount of space taken up.
@siggi1b1svela
@siggi1b1svela 11 жыл бұрын
There is no devision. length of array * size of datatype = size of array so an empty array of, let says doubles, will be 0(length of array) * 8(size of a double, on my system) which is 0. Tings vary form compiler to compiler, and from system to system, but i feel pretty confident to say that an empty array of any data type will always be 0 bytes Hope i helped.
@siddharthb.v4944
@siddharthb.v4944 9 жыл бұрын
yup you should add a return (0) ; after the cout statement....which indicates that the main will return a 0 if there was no error. if there is any error it will throw some garbage value and you'll know that there is some error in the code.
@Aaronster8
@Aaronster8 13 жыл бұрын
you can also do sizeof(c) / sizeof(int)
@thegamingruler1996
@thegamingruler1996 12 жыл бұрын
or you can get the size of the type of element for example you can write cout
@ethanhunt1032
@ethanhunt1032 5 жыл бұрын
can it be written " sizeof(double)" instead of " sizeof(bucky[0]) " ??
@alexandrufilipescu1301
@alexandrufilipescu1301 5 жыл бұрын
it can, but what if you change the data type? it is more efficient as Bucky did.
@tedtdu
@tedtdu 13 жыл бұрын
Point here is that you should know there are a lot operators like that and you can not remember all of them , neither do you have to...rather learn to find out these operator that meet your needs
@DragonDePlatino
@DragonDePlatino 9 жыл бұрын
#include using namespace std; int main() { char mander; cout
@delavago5379
@delavago5379 8 жыл бұрын
lol
@gage2560
@gage2560 7 жыл бұрын
nice...
@togmeister8604
@togmeister8604 9 жыл бұрын
For checking array size are you suppose to get the same size as you. With a array size of 10 I get 40 not 80.
@Nahiyan12
@Nahiyan12 13 жыл бұрын
@TheMrNoda Bucky teaches a lot of languages, he taught us about the file type double in one of his Java tutorials. He thought that we already know double by mistake lol Anyway, double is just like a float data type but it takes double memory compared with float(I guess why it's named double lol)
@seigeengine
@seigeengine 12 жыл бұрын
When you create an array of n elements, the array indices go from 0 to n-1.
@zakp8687
@zakp8687 8 жыл бұрын
How have you made a series on c++ and not made a video on vectors
@princekhurana14
@princekhurana14 12 жыл бұрын
Bucky !!! sizeof() is not a function , it is an operator. Thumbs up if you know that.
@maximbelyaev8316
@maximbelyaev8316 6 жыл бұрын
am I right that sizeof() result depends on a compiler you use but the processor architecture? if so, sizeof(int_type_variable) is equal to 4 bytes for any standard c/cpp compiler.
@Qazqi
@Qazqi 11 жыл бұрын
I think you meant 1 byte is *usually* 8 bits, 1 kilobyte is 1000 bytes, and 1 kibibyte is 1024 bytes.
@jt1250champ
@jt1250champ 12 жыл бұрын
char is for like a single letter while string is for a "string" of characters.
@PenguiniugneP
@PenguiniugneP 9 жыл бұрын
Bucky can u do some videos for OpenGl ? :) ty ;)
@RadicDotkey
@RadicDotkey 6 жыл бұрын
Why using sizeof(array)/sizeof(array[0]) wnen you can simply use array.size() to get the number of elements. What’s more. The first option will throw an exception for the array with 0 elements.
@1kalekip1
@1kalekip1 11 жыл бұрын
I didn't try it, but what would happen if the array was empty? You can't divide by zero. Do you get an error message?
@togmeister8604
@togmeister8604 9 жыл бұрын
Bucky, you should create a game or something. Like open a indie company. It would be really cool to see some of your games and your experienced enough to do it!
@hovhannesvardanyan3921
@hovhannesvardanyan3921 7 жыл бұрын
How can I see the execution time in my C++ program, like he does?
@w0mblemania
@w0mblemania 13 жыл бұрын
@1990Abbadon You could, but it's a dangerous practice. Say you have hundreds of "sizeof()" calls all through your code. One day, you change the type of "bucky" from "double" to, say, "char" or "int". Suddenly, sizeof() returns a different value! Ouch. Which means the programmer has to (1) detect the problem and (b) go and change those hundreds of lines of code. Thus, it's best to always work with the variable name, rather than the type.
@colewasserman6394
@colewasserman6394 8 жыл бұрын
Random Question. What variable type is a string stored in and how do you test one in an if statement
@DTX_
@DTX_ 8 жыл бұрын
+Cole wasserman Well, its late but.... If you want to create a string you have to create a variable of the data type string. So: string name = "Daniel"; This would create a string type variable and store the string: Daniel. Remember to put the " " and the ; . You can evaluate it like every other variable: string name = "Daniel"; string customer = "Carl"; if( name == Customer){ then blabla... } else { bla foo blah }
@mannyt814
@mannyt814 8 жыл бұрын
Its a little late too, but also include the string library #include to work with strings.
@crossroadsc-1378
@crossroadsc-1378 6 жыл бұрын
I divided by size of 2 elements but it still gave me 10, why?
@cagan8
@cagan8 9 жыл бұрын
even though i change sizeof(bucky[0]) to something else like sizeof(bucky[2]) it still gives me 10. Shouldn't that supposed to be 5
@StrongDenim
@StrongDenim 9 жыл бұрын
+Çağan Sevencan It is the same : HEre I give you an example #include using namespce std; int main(){ int bucky[2] = {5,10}; int bucky2; cout
@arcanerstudios
@arcanerstudios 7 жыл бұрын
from pointers to sizeof then to pointers again. Why?
@HermanWillems
@HermanWillems 6 жыл бұрын
Pointers is an emotional subject thats why. (For real... alot things are weird about this series)
@SourabhBhat
@SourabhBhat 8 жыл бұрын
This way of finding the length of array inside another function doesn't work!!! Is there a way of finding length of an array passed to a function? I know that we normally pass the length explicitly. I got so excited when Bucky showed this method, but unfortunately it doesn't work for passed array to another function.
@SourabhBhat
@SourabhBhat 8 жыл бұрын
+Peterolen Thanks for this info!
@alexdivito8170
@alexdivito8170 9 жыл бұрын
when you say "a double is more precise than an int data type" does this mean that the double can just hold a larger number? or does it mean that double can also have decimal places making it more precise?.. i'm confused
@jaleesabevelle3330
@jaleesabevelle3330 9 жыл бұрын
Alex Di Vito Its actually both in the case of the double. The double usually holds around 8 bytes as opposed to the int data type which only holds 4 bytes. But the double data type is also going to be more precise as it relates to accuracy because of the decimal place.
@flow1465
@flow1465 9 жыл бұрын
+Jaleesa Bevelle so in short it can store both decimal and whole number??
@berniemacandasideoffries
@berniemacandasideoffries 9 жыл бұрын
+dushyant singh It'll automatically make it a decimal, try printing out a double to the screen. Unless you format it to print otherwise, it'll print a lot of trailing decimals
@flow1465
@flow1465 9 жыл бұрын
Kavanaugh Dempsey yeah so double can hold both decimal as well as integers
@tanujvishnoi7219
@tanujvishnoi7219 8 жыл бұрын
Sir we are making a string variable. Eg: string na=""; string na1="SIR"; cout
@HermanWillems
@HermanWillems 6 жыл бұрын
string is not a core type. It's a CONTAINER. That's why you need to do #include You never do #include right? Containers also have member functions like string test = "hello"; And then you do test.length() which give you the ammount of characters in the string. A container is a full object. A string is an object. Before string was added to the standard library STD everybody made their own "string" classes to make strings. This is why they standardized it.
@TheV3ctro
@TheV3ctro 11 жыл бұрын
double x[9001][9001]; cout
@Veldr0N
@Veldr0N 8 жыл бұрын
What is double ?Bucky didnt talk about it in any video.What is it used for ?
@neomaxtaria570
@neomaxtaria570 8 жыл бұрын
A double is a 64-bit (8 byte, for x86) length data type that represents a number, with decimal places.* *edit: i messed up
@Veldr0N
@Veldr0N 8 жыл бұрын
Wasn't float the same thing ?
@neomaxtaria570
@neomaxtaria570 8 жыл бұрын
Float is 32-bit and has lower precision (it is 4 bytes, and can't get the same size), but effectively, yes.
@treetoon-tf
@treetoon-tf 12 жыл бұрын
isn't char prounanced "kar", as in character?
@TheVideoVolcano
@TheVideoVolcano Жыл бұрын
So no Bucky.length() ?
@thomasip9938
@thomasip9938 9 жыл бұрын
Why does my console crash when I try to do this? int main() { int c[10]; cout
@1dries3
@1dries3 9 жыл бұрын
+Tommy Ip int main() { int c = 10; --> you typed it wrong. cout
@siddharthb.v4944
@siddharthb.v4944 9 жыл бұрын
+Tommy Ip You need to add a return statement at the end of the program. This is because you have used an integer return type for your main function.
@thomasip9938
@thomasip9938 9 жыл бұрын
+Peterolen no error message, I ran the program and the command prompt just goes not responding
@thethreetrain
@thethreetrain 9 жыл бұрын
+Tommy Ip return an int boiii
@rabimoshehizskiaavnergolde3195
@rabimoshehizskiaavnergolde3195 8 жыл бұрын
im so late xd you need to put: getchar(); return 0;
@bilalarain4632
@bilalarain4632 4 жыл бұрын
thank you. It Helped Alot.
@soumithpotturi2090
@soumithpotturi2090 9 жыл бұрын
Explained what float was in the 23rd video and what char is in the 40th Video :) Too soon huh bucky?
@anteconfig5391
@anteconfig5391 7 жыл бұрын
wtf my doubles are only 4 bytes and I'm on a 64bit PC. I'm sure it's fine on my linux but still, how do I correct this? scratch that..... my doubles were ok... it's my unsigned long int they're supposed to be 8 but they're 4 arg
@chxse1817
@chxse1817 7 жыл бұрын
i'm on a 64 bit linux and i get 8 bytes
@Ashkebooze
@Ashkebooze 11 жыл бұрын
Actually they're bytes. How could a char be represented by 4 bits? 2^4 = 16 different combinations that can be represented by 4 bits. Not enough to cover the entire ASCII/UNICODE alphabet.
@bala2crazy
@bala2crazy 12 жыл бұрын
Which C++ compiler do you use? :-\
@doodies1234
@doodies1234 12 жыл бұрын
When do i use "string" and when do i use "char"?
@gln555
@gln555 5 жыл бұрын
Replying to a 6 year old comment I know silly. But others may look at this. string is multiple characters. string a = "how does C++ work?";. A char is a single character "char c = 'a';". trying "char c = "mom help me."; would result in a compiler error or only give you the first letter 'm'. There is a way to have a char pointer (i.e. char *) point at the start of a string but most C++ developers use std::string instead.
@pradyumnkejriwal3007
@pradyumnkejriwal3007 8 жыл бұрын
What is the point of the sizeof() function
@antiHUMANDesigns
@antiHUMANDesigns 7 жыл бұрын
When dealing with memory or files, you may need to know the size of different data types, for example. Files, speficially, when reading binary, will quite definitely require that you know the size of different types. But you *can* skip the sizeof() operator (it's an operator, not a function, no matter what bucky says), and just manually write the size of a type if you know it, it's just poitless since it doesn't cost you anything, and it makes it easier to change things and so on. Say you have a file where the first bit of the file is a header hat specifies the format of the file, and the rest of the file is the actual data. If you have a struct that holds all of the values taht make up the header, you'll need to know the size of that struct so that you can read that much data from the file, and know that this is the header section. If you don't understand, try doing it and you'll see why it makes sense. A more advanced thing is when you're trying to optimize for good cache line usage, you might want to know the size of the data you're processing to see how to line them up to avoid "false sharing" of cache memory. But this is very advanced stuff. My point is that it has many quite important usages, from simple to advanced things. But it's mainly for convenience. You'll always be able to "manually" know the size off the datatypes you're using, so you could write their sizes manually, it's just going to make it easier to make mistakes, and it might not port between OS's, and it's much harder to update/change, later.
@chili24137
@chili24137 11 жыл бұрын
woot, made it to tutorial 40!
@Qazqi
@Qazqi 11 жыл бұрын
You can't have an array of length 0. It's forbidden by the standard.
@dearshoberoi285
@dearshoberoi285 5 жыл бұрын
FF Fanatic its the element no. 0 not the size of array
@thaer12345
@thaer12345 12 жыл бұрын
so do you pronounce it "tsharacter", bucky? or "karacter", like normal people? So why do you pronounce "char" as "tshar"?
@Perticus13178931
@Perticus13178931 12 жыл бұрын
I also got 4. WE ARE MEANT TO BE BUCKY
@itskiefer
@itskiefer 12 жыл бұрын
Charizard, Go! Charizard uses Rock Smash! It's super effective!
@1990Abbadon
@1990Abbadon 13 жыл бұрын
you could also write "sizeof(doulbe)" instead of "sizeof(bucky[0])" great tutorials!
@rafaelandregallosoandia3200
@rafaelandregallosoandia3200 4 жыл бұрын
what is "size_t" ?
@elmortal2323
@elmortal2323 11 жыл бұрын
What program do you use to code?
@restfulchaos
@restfulchaos 11 жыл бұрын
codeblocks is what he uses, I highly recomend sublime though. 100x better
@Bartono0128
@Bartono0128 11 жыл бұрын
I think using Linux is the best way to go, goes much easier than using any program under windows (I installed a Kubuntu-VirtualMachine in VirtualBox - works like a charm
@Bartono0128
@Bartono0128 11 жыл бұрын
Bartono0128 )
@Mauri6870
@Mauri6870 11 жыл бұрын
jeremiah howell I installed sublime but i have a tiny grievance with it. Whenever i place my cursor next to a bracket, it doesn't highlight it in the same visible manner in which codeblocks highlights it. Do you know how to change it? Example of what i mean: imgur.com/a/aVfLB
@Howtodothatshit
@Howtodothatshit 10 жыл бұрын
***** It is not called the Compiler IDE.. It is called the IDE. Just IDE, not anything extra. The compiler is what compiles the code down to machine code, so the computer can understand it. The most commonly used compiler is GCC, but there's also many others such as Clang, Borland C++, Turbo C++ & Of course Visual C++ and many others.. Each compiler compiles the code differently, some compilers are so effecient at compiling that it makes the compiled program faster than if they were compiled with another compiler. Some compilers are cross-platform (Windows, Unix & Other OSs. Some are compatible with C++11 some are not. The most common used compiled GCC is fully cross-platform, is compatible with C++11 and is under the GPLv3 License.
@superpb600
@superpb600 10 жыл бұрын
That's a creepy way to check an array size when you're used to Java where all you have to do is array.length... At first sight I thought that it wouldn't work with string arrays, since as far I know each letter uses 1 byte, making each element use a different amount of memory, which doesn't happen idk why ^^
@illyakoshkin3771
@illyakoshkin3771 10 жыл бұрын
what do you mean under "string arrays?" Is it an array of strings or just a string? Either way, string takes 4 or 8 bytes depending on your PC (for me its 4, but who cares)). You can check the length of your string in chars using the same func as in Java (for instance: int name = "name"; cout
@superpb600
@superpb600 10 жыл бұрын
Eli Kosh Yes, sorry I meant an array of strings, and I also meant that a string is supposed to have dynamic size depending on the amount of characters that it contains, so a string with 4 letters would use up to 4 bytes of memory, and a string with 10 chars would take up to 10 bytes of memory, it's not possible that a string would take 4 or 8 bytes depending on the PC, otherwise we would be able to transfer huge books using only 4-8 bytes! When you're transferring a string through network you must send a byte telling what's the size of the string, or read incoming bytes till find a byte which determines the end of the string. So since every char in a string is supposed to use 1 byte of memory and sizeof method return the memory that a string uses a string array like: string text = {"123456789", "123", "12345"} would take 9 + 3 + 5 = 17 bytes of memory instead of 3 from my point of view, Obviously there's some explanation to sizeof(text) return 3, but I don't know what's it... actually I think that I just figured out, the sizeof(array) doesn't return the size of the array elements right? so every array will have the same size * element count depending on the computer?
@illyakoshkin3771
@illyakoshkin3771 10 жыл бұрын
Pb600 the size of string is fixed and it is based on size_t. You can find out how many chars you can fit into a string on your PC just typing stringName.maxSize(), which usually == to 2^32 == 32bits == 4 bytes))) sizeof(text) will return 12 (in this case) and declaration should be string text[] = ...; or you will get an error. sizeof(array) will return its size in bytes, which is = to number of elements times the amount of memory array type takes. in C you will use something like: int arraySize = sizeof(array)/sizeof(itsType); to find out the size of an array.
@superpb600
@superpb600 10 жыл бұрын
Eli Kosh Okay I fail to understand how a variable that can hold billions of letters can use 4 bytes of memory, that's same as saying that an integer can hold up to 11 trillions of values only using 4 bytes >.> looks more like its 'size of variable type' than 'size of variable', I still don't understand how string can have fixed size...
@PS2Damon
@PS2Damon 9 жыл бұрын
Pb600 creepy? how the fuck is it scary
@SuperEngsmsm
@SuperEngsmsm 11 жыл бұрын
But if i have string , how can i know the number of its chars ??
@WisamKAbed
@WisamKAbed 5 жыл бұрын
By using string name.length property
@sernikpl2010
@sernikpl2010 12 жыл бұрын
Bucky pronounces Byte in a funny way.
@alizafar4399
@alizafar4399 9 жыл бұрын
every men loves watermelon 1:29
@kam00
@kam00 11 жыл бұрын
no... just no... Here is some logic to prove you wrong. the size of a char is 1. a bit can only contain a 0 or a 1 that means 2 different chars e.g. a and b. there are way more than 2 chars on a computer. 1 byte is usually 8 bits. they can look like this: 1100110 the highest 1 bit number you can have is 11111111 which is 255 (2^8-1) that gives 256 combinations. (0 to 255) If there are 256 chars exactly I don't know but thats alot more chars than just a and b.
@1kalekip1
@1kalekip1 11 жыл бұрын
I'm talking about 5:00 he is dividing.
@vericblaisky3015
@vericblaisky3015 5 жыл бұрын
double is not int it's longfloat
@Rabolisk
@Rabolisk 9 жыл бұрын
Isn't bucky[10] have 11 elements? since it includes bucky[0]?
@vilmiswow
@vilmiswow 9 жыл бұрын
Rabolisk But when you say example : int c[3]; That doesn't mean that you can write 4 arrays :D
@minemaninventer
@minemaninventer 12 жыл бұрын
One of the only popular videos I've seen with 1 dislike. 1!!!!
@PS2Damon
@PS2Damon 9 жыл бұрын
what does double mean
@EchoV9
@EchoV9 9 жыл бұрын
+PS2Damon It's a variable type. www.tutorialspoint.com/cplusplus/cpp_variable_types.htm
@samithkarnekar187
@samithkarnekar187 9 жыл бұрын
double of an interger i guess
@EchoV9
@EchoV9 9 жыл бұрын
+Samith Karnekar Negative. Different than an integer- integers are whole numbers while doubles are for decimals and larger numbers out of the range of int.
@CrazzyCrisis
@CrazzyCrisis 8 жыл бұрын
Well, to put this simply, Int (Integer) is a whole number. No decimals a float (floating point) is a type that can hold a value with a decimal point, up to 7 digits worth of precision double is a larger type of float that holds more digits(15), and therefor is more precise at the cost of memory.
@koustubhsharma2807
@koustubhsharma2807 4 жыл бұрын
bro it is the same size of c if there is on my comp
@SidMed614
@SidMed614 10 жыл бұрын
You can use this in for loops. :)
@Moon_Rose달장미
@Moon_Rose달장미 4 жыл бұрын
so basically, char is character?...
@subratmainali8860
@subratmainali8860 11 жыл бұрын
sigurd is correct.. 1024 bits= 1 byte.. 1023 bytes= 1 kilobyte.. and so on..
@josher3436
@josher3436 9 жыл бұрын
Big thumbs up. Thanks......
@1990Abbadon
@1990Abbadon 13 жыл бұрын
@w0mblemania thx a lot for that hint
@coolshoos
@coolshoos 11 жыл бұрын
They're bits . . . not bytes, Bucky.
@xsyed
@xsyed 12 жыл бұрын
mine output printed as 1
@AayushNaik
@AayushNaik 12 жыл бұрын
Check out the transcript... Next Video=Unexploded....
@ethanviolet1
@ethanviolet1 6 жыл бұрын
Something peaked my interest in the array of bytes thing, so I decided to see if I can use all the ram on the machine. it didn't let me! :( double x[99999]; std::cout
@SmithsRichard
@SmithsRichard 12 жыл бұрын
7 bytes sir!
@johnthesman
@johnthesman 13 жыл бұрын
80 bytes, 80 likes
@seigeengine
@seigeengine 12 жыл бұрын
That's not an answer...
@RuberSocks
@RuberSocks 11 жыл бұрын
try if feyget
@xRxSaifali
@xRxSaifali 10 жыл бұрын
mine said 4
@tayyabmazhar9985
@tayyabmazhar9985 7 жыл бұрын
" yate yata"
@techgod360
@techgod360 5 жыл бұрын
Do this: #include using namespace std; int main() { double b[1000000]; cout
@Platifiy
@Platifiy 11 жыл бұрын
You mean eleven elements.
@WisamKAbed
@WisamKAbed 5 жыл бұрын
No it's 10 element, starting from 0 to 9
Buckys C++ Programming Tutorials - 41 - Pointers and Math
6:05
thenewboston
Рет қаралды 365 М.
My 2 Year Journey of Learning C, in 9 minutes
8:42
VoxelRifts
Рет қаралды 684 М.
Почему Катар богатый? #shorts
0:45
Послезавтра
Рет қаралды 2 МЛН
The Lost World: Living Room Edition
0:46
Daniel LaBelle
Рет қаралды 27 МЛН
Master Pointers in C:  10X Your C Coding!
14:12
Dave's Garage
Рет қаралды 343 М.
Buckys C++ Programming Tutorials - 31 - Recursion
8:19
thenewboston
Рет қаралды 551 М.
Is memcpy dangerous?
14:08
Jacob Sorber
Рет қаралды 24 М.
Every Minute One Person Is Eliminated
34:46
MrBeast
Рет қаралды 10 МЛН
you will never ask about pointers again after watching this video
8:03
Buckys C++ Programming Tutorials - 27 - Random Number Generator
9:53
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 5 МЛН