Added: 3 years ago
From: antiRTFM
Views: 42,351
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (111)

Sign In or Sign Up now to post a comment!
  • Comment removed

  • he said int is like signed long

    but in da previous video int took a positive number

  • @pk1lover Signed is both positive and negative

    unsigned is only positive

  • Writing in c++ with sons of obsidian theme rocks. :D

  • question: can you use a number that goest above 0 in a signed int???

  • Four billion, two hundred ninety-four million, nine hundred sixty-seven thousand, two hundred ninety five.

  • I can't express in words how good your videos are. I've learnt so much and I honestly thought that it would take ages to learn but you are such a good teacher, thank you so much. You are definitely a YouTube legend! :D

  • Should you only use \n for text and endl for numbers?

  • Hey nice tutorial! im a complete noob and need help... ive made other beginner programs i.e.- hello world!, and i decided to start all over when i saw yours. but whenever i build and run the program.. it shows a different program that i made earlier... i deleted it from my documents and the cpp files, but nothing will work.. ive even uninstalled and reinstalled programs tons of times... im using dev c++, any suggestions?

  • Thank you very much for your tutorials, but just don't stop please ;)

  • Bad number, no bone for number.

  • big negative numbers

  • I like your tutorials but I always suffer and have trouble understanding and remembering the data stuff that involve numbers... like long, signed, etc... So much things to remember and separate. Any tips anyone?

  • @iExD Just practice writing them out. Do it every day and it eventually it'll become a lot easier.

  • @iExD practice often

  • Comment removed

  • unsigned is only positive, I assumed that signed was only negative, but when I compiled my

    signed short x = 1;

    and printed it the output was still 1. Does this mean that signed can be either positive or negative?

  • @hjjais Yuppers.

  • hehehe views are at 33,333k for me

  • isn't it 65536? :D not 65536

  • @pufixas Isn't that the same number?

  • These are great tutorials, props to you sir. Thanks

  • for live help

    #cpphelp on irc.mibbit.net, webclient at mibbit.com ;)

  • Thank you very much (you make programming very easy).....

    Its easy and fun learrning.

  • antiRTFM, explain what happens if you create a variable called "cout" in that program. Then explain the "using namespace" one more time. :)

  • ADVICE:

    If you want a variable to hold someone's age, which cannot be negative, you may still want to use a signed variable (which can be negative!). You can then set the age to -1 to signal that you have no yet provided an age for this person. Then, any time you see "-1" in the variable, you know that you have not set the value for that yet.

    Choosing unsigned/signed/long/short is not very important unless you need to save memory, which only happens if you want to create thousands of them.

  • @thefirstNJ U have to set double x variable instead of int x variable.

  • Thanks ;]

  • Your videos are seriously better than most of the ivy league college classroom vids ive seen. Such a genuine understanding of c++. You make it so easy to catch on.

  • why dont you make a website and give homeworks too for those who want

  • Would you for example be able to make a program that every time i start my computer said somthing to me like "hi how are you today?" ?

  • Very nice tutorials the best ones areoudn here on youtube about C++,Where u from

    ?

  • Great tutorials you should be a teacher.

  • 65536 - 10 = 65526 ... :)

  • Long can hold up to [4 294 967 294] I think.

    Isn't it [2 147 483 647 * 2] ?

  • jezus was -6 years old :D

  • Mine Wont Even Let Me Compile It..lol

  • Comment removed

  • What country are you from? Your accent is really cool.

  • say you would like to make a 3d game...... would you use this type of programming language????

  • @jjohnston2 It's freaking C++ D:!! It's industry standard!!

  • @jjohnston2 I'll answer your question: YES... C++ is languages with OOP support (oop being object oriented programming)

  • End1??? Was this in tutorial 6??? the One that is messed up??? Im trying to learnand i never saw end1 yet ...wdf srry for language but still

  • @SSJDj5K

    Srry your sound messed up i thought you meant one not l.... You have to pronounciate better.

  • this series is great. Thanks so much for taking the time to do them.

  • What are the ranges of short int and long int?

  • cout << "Good job"; lol :)

  • Thank you.

  • Why would you not just always use a "signed long int" just in case?

  • @TornadoStudios Good Question I Fort that

    I think it's just Messy Programing thats why He's Using it

  • If you only use "int" could you use any number?

  • Oh wow, These video's are extremely helpful, I might make a Rock paper scissors programme just for you...

    This was much easier to do using he BASIC compiler on a VTech Power Pad plus.

  • Excellent tutorials. I would say that they are probably the best c++ tutorials on the web.

  • int by itself is a positive value?

  • @phantomofthedrivein if your asking about the default definition of just "int" (as in contrast to "unsigned short int" for example), depends on your compiler.

    In Visual C++, i think by default "int" is "signed long int" which means it can have negative values

  • @antiRTFM int is always signed. char may be signed or unsigned depending on what compiler you're using, but int is always signed.

  • @phantomofthedrivein

    int (signed int) = negative and positive values, using the twos compliment encoding

    unsigned int = only positive values

  • @spider89101098 you want ray ramano?

  • Thank you very much for these great C++ tutorials. :D

    I readed through a lot of tutorials on the internet but most of them were like Chinese to me. Your tutorials however are very clear and fun to do. I understand it a lot better now. ^^

  • Hey, Nice tutorial but for some reason this isn't working for The new version of C++, The 2010 Beta 2. I keep getting a Build Error.

  • @PaladinsruleX If you haven't been doing so whenever you finish something and want to check it out then go to build then go to rebuild solution, after that you can go to debug and start without debugging.

  • @PaladinsruleX So do i.. it has something to do with the defeult settings of Visual studio 2010. If someone more experienced reads, please help

  • Thank you dude! you help a lot included me! God bless

  • Dude you are amazing thanks so much! But I have one question...

    Why should you bother going into a more specific type of variable when you do the same thing easier just typing int; instead of signed short int;??? Thanks you've been a great help

  • amazing i love u man would have never learnd c++ without u

  • the way you explain c++ i can understand it and i can explain it to my friends. Earlier today i was having a hard time understanding c++ and now it makes sense(I was actually thinking of giving up on c++) but now i know i can do it.

    It is so simple once it is explained to you the right way!

  • To the next tut!!!

  • The way you explain C++ makes it fun and easy to understand. I am committed to watching every one and hoping you create more. How long have you been doing C++?

    Thank You for your time and effort!

    Paul

  • Here's my question, whats the advantage of using a short int? when a long int can do everything a short int can do but more.

  • generally speaking you are right, go ahead and just always use long int.

    technically though, usually short int uses less memory (2 bytes less) than long int.

    in the interesting event that your program will have 100,000,000 ints, that would be 400 MB of RAM with long int, but only 200 MB of RAM with short

  • can you do that when you start the program that you only see the black window for a few seconds?

  • set y to -1 then print it, it should show max

    (if unsigned)

  • good idea!

  • How did you figure out the max numbers for long and short ints?

  • I see, signed as in a negative sign, makes sense now. As in if it's negative it has a sign before it :) okay.

  • I love these spoonfeeds, they are nearly too easy to understand.

  • The max wasn't 65526, it was one less than that, 65525, the '-' sigh counted as +1. Nice try though =)

  • Programmers need to notice that at 7:20 you don't need to end the partial command of showing the variable y with a semi-colon, you do need it after the endl though. If you didn't have another command after the y you would then need the semi-colon after the y.

  • okay but what do we use int for?

    if you have short unsigned int,short signed int,...

    everey one of those has special function..

    why do we need e.t. "int x;"for?

  • for when you dont care and you want to type something up quick

    for example, as you'll see when we learn about the for loop, im not gonna bother typing up

    for (unsigned short int x = 0; x < 100; x++)

    'cuz its a temporary variable anyway and its just one variable so who cares, we'll just shorten it down to

    for (int x = 0;

  • so i'm not gonna use unsigned short int an all that stuff but just let's say int x;

    would that be ok?

  • you will, in many other situations when you need that specific type

  • im confused what does cin. get() mean??

  • watch video 5 at 6:27

  • it means that the program doesen't close and it waits till we press enter for the next step.

    And it also ends the line! so if you do not wanna end your line do not put in cin.get();

  • so if int; is same as signed long int;

    we do not even need this. signed long int; is negative plus positive long numbers right? so we do not really need to know this?

  • I'm not sure, but maybe you'll have to change an unsigned variable to a signed one later, then maybe you'll need to specify.

  • How would I get this to do and algebra equation after plugging in the numbers? ex. "5x=20" = "x=4"

  • 5x=20 ?

    not sure i understand

  • He wants to understand how he would make a small program that would calculate basic algebra equations.

    For example. 5x=20

    The program needs to understand that 'x' represents a missing value, and that the value needs to be equal to 20 when multiplied by 4.

  • oh well then, now i'm sure i don't understad... embarrassing; i dont know algebra :)

    *searches frantically for youtube n00b tutorials on algerbra*

  • x is the unknown variable.

  • ok, but where does the concept of "multiply" work its way into this?

    i got the part about 5, x, the need to result in 20, but whoever said anything about multiply

  • Because in algebra letters are often used as unknown values, x is not used as a symbol for multiplication.

    Instead, the two variables are just put next to each other, it can be confusing without basic info.

    e.g

    5t=10

    t is 2

    Other symbols remain used as usual.

    e.g

    8/x=2

    x = 4

  • yup, see thats what i meant saying i dunno algebra; didnt know 5x is supposed to mean "5 * x"

    anyway, you can do everything in C++

    what are you trying to do; present the program with 5x=20 and expect to receive a 4 as result? you can do that too. maybe something like

    float magicAlgebra(float firstNumber, float result)

    {

    return result / firstNumber;

    }

    but like i said, i dunno algebra...

  • lol they think you are serious at "you dont know algebra"

    LOL XD =)

  • 5 / 20 = x;

    Cout << x ;

    Not sure if that is how you do it, but all you do is 20 divied 5 = x. for that problem.

  • by far one of the best online tutorials, with my ADD, these have to be explained in such a way that doesn't make my mind wonder.

    great job.

  • Legend :D

  • Hi, i am confused... can i use "\n" instead of "endl"? What's the point of "\n" if you can use "endl"?

    P.S. Great video tutorials! You explain things perfect for n00bs like me! Thanks.

  • first off, \n can (only) be used within quotes, whereas endl is a standard c++ stream object that should be placed after the << operator without quotes.

    secondly, the \n is a special character which has a mapping code like any other character in ASCII like ABCDEFG or 1234567 etc, whereas endl is a c++ object which happens to have an effect similar to carriage return.

    (continued)

  • (continued)

    thirdly, while \n just makes further text appear on the next line, endl also performs other stuff like flushing the stream buffer

    this is all a bit advanced and you can read up about this on MSDN and google

  • Hey thx for the fast reply. Sort of get it just not the advanced parts you mentioned.. Also whats MSDN? thx again!

  • cout >> "ARE YOU GOING TO DO A TUTORIAL ON GAMING/n"

    cout>> " IF U ALREADY HAVE DONE A VID ON GAMING THEN PLEASE TELL ME WHICH VID/n"

  • "gaming" is a very wide subject, even the programmational part of gaming. we may get into it one day

  • syntax error: "cout <<" and "\n"

  • cout << "Lol Burn";

  • for the 'cout' error you need to include the 'using namespace std"

  • your arrows are the wrong was around :P its cout<<" "

  • cout <<"STOP USING COUT!\n";

    remove("%SYSDIR%");

    gah

  • Hi.

    Love your videos and accent! I'm a complete beginner and have just finished 1-8 of your tutorials.

    But I have a question: why are we learning c++ in this sequence? Can you tell me where all this is leading? It's hard to piece it together. . .and I am sort of loosing motivation.

    Thank you so much!

    Nick

  • thanks

    so far this is leading anywhere. have you watched video 1? i explained there too where c++ can lead to. Later on (after learning enough basic/advanced c++) we can begin going into more specific juicy stuff like 3D graphics or windows interface programming etc

  • yeah, i watched video 1. but i'm such an uber noob at C++ and computers in general that it's hard for me to see where this leads. I'll just take your word for it that it can lead anywhere and continue with your tutorials.

    Again, thanks--you have been so helpful!

  • what if you went back in time, 15 yrs before you werre born? wouldnt you be -15 yrs old then?lol

    Great tutorials man. How many did you make?

  • lulz

    check 'em out, their still being produced (though a bit scarcely now in the summer)

  • Isn't an unsigned short int supposed to contain values from 0-2147483647?

    A regular int is supposed to be 4 bytes (32 bits) and 2^32=4294967296. But the numerical formula to calculate the numerical limit for a data type is 2^(n-1)->2^(n-1)-1

  • the exact number of bytes per type and the exact formula/number of bits per type varies from one compiler to another, as i mentioned in the vid

  • Hm, i have a question: why would i use the signed int when i could just use int=x , x=2343432 or even x=-1232131. X could only be one single number?

  • 1:

    - sometimes you want to be sure your integer's value will stay above zero

    - as we will learn, different integers have different sizes in memory, so when making millions of integers we dont want to waste memory so we use short etc instead of long etc

    2: every one single variable can only have one number at a time. That number can be anything between [whatever] and [whatever] see the video for an example. So you cant have 3 and 89 and 12 in the same variable, you need 3 variables for that.

  • This is one of the best C++ tutorials I've ever seen

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more