Buckys C++ Programming Tutorials - 45 - Member Initializers

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии •

  • @briandavis2063
    @briandavis2063 9 лет назад +588

    If you've made it this far and you've given your best efforts in your endeavors to understand C++, give yourself a round of applause. Close to a million people have watched the first video and many of them have stopped watching, and I'm going ahead to guess and say that they've given up. Not us though. We are determined and focused and we will master this programming language. Congrats to everyone so far as this is something we should all be proud of! Onward to tutorial 73!

    • @chris200830
      @chris200830 9 лет назад +52

      Thank you for saying that! It brought some hope for myself and i'm sure for other people too. I'll see you at the finish line :D

    • @noahclark6620
      @noahclark6620 9 лет назад +17

      Wo, dude thanks i agree with chris you did just give me alot of hope! See you both at the finish line.

    • @cbernier3
      @cbernier3 9 лет назад +4

      ***** It's like he said, you are required to do it this dumb way if you need constant variables in your class.

    • @RealEyes24
      @RealEyes24 9 лет назад +5

      Brian Davis many of them have stopped watching because his lessons are pretty low...you won't get a job in C++programming with these kind of lessons that he presents here

    • @cbernier3
      @cbernier3 9 лет назад +11

      You need all these lessons before you can move on to more advanced stuff. pascalirinel

  • @Music20079
    @Music20079 8 лет назад +89

    It's been 5 years but to enable word warp:
    Settings -> Editor -> General Settings -> Other editor settings(second tab) -> check box "Word warp".
    Awesome tuts by the way.

    • @bluewetball
      @bluewetball 7 лет назад +5

      it's been a year, but word wrap* ;)

    • @ReddoX30
      @ReddoX30 4 года назад +4

      "Make sure you spell it wrong." - Bucky

    • @gluebluerock136
      @gluebluerock136 4 года назад +1

      It's 8 years... Damn

    • @youssefa.8313
      @youssefa.8313 4 года назад

      @@gluebluerock136 9 years !!!!

    • @raymondphilip6232
      @raymondphilip6232 3 года назад

      @@youssefa.8313 9 +a few mos

  • @fiddlerontheroof4942
    @fiddlerontheroof4942 10 лет назад +11

    In case you have not found out it yet - to wrap words: go to main menu Settings ( right before Help), Editor, Other Options, Word wrap.
    To Copy/ Paste with right click - right click, hover Edit - there are all regular Edit options. A long option though.

  • @avataroke9562
    @avataroke9562 3 года назад +3

    Damn it has gotten crazy! You the best teacher though I don't think I would have gotten this far without you. 🙏🌿💯✌️

  • @addobandre99
    @addobandre99 12 лет назад +1

    I followed the Java Beginner and Intermediate tuts and I when I wanted to learn C++ I just searched in your channel right away!

  • @headoverbars8750
    @headoverbars8750 3 года назад +3

    Why do other people have to make this stuff so complicated?
    This is super easy!
    When shown with regVars and Tunas it all makes sense.
    Thanks Bucky

  • @AyushSourav
    @AyushSourav 8 лет назад

    --> Word Wrap Setting in CodeBlocks

  • @xxLAKERS4LIFExx
    @xxLAKERS4LIFExx 12 лет назад +1

    keep working hard and doing the right thing everyday- Adam Morrison

  • @saqibbashir7342
    @saqibbashir7342 12 лет назад +1

    yup,He is great in explaining difficult things in simple ways..thank u Bucky..i am searching for your more and more videos..

  • @PyraxV
    @PyraxV 8 лет назад +8

    This is the one video from you I had to replay lol. At first, this confused me.

  • @serjeelranjan8345
    @serjeelranjan8345 5 лет назад +6

    Damn perfect tutorial. Yes the syntax is pretty fkd up.

  • @forbidden.404
    @forbidden.404 11 лет назад

    Because the compiler reads the code char by char, it doesn't matter the tabs or breaklines, you could wrote an entire program using one line

  • @noorsilkaredia
    @noorsilkaredia 11 лет назад +7

    we can also do it in this way....
    Sally::Sally(int a,int b){
    regVar = a;
    constVar = b;
    }
    this works same and its pretty simple

    • @Vivid_Facts
      @Vivid_Facts 11 лет назад +1

      Go on this link and share with your friends

    • @laststylemover
      @laststylemover 10 лет назад +2

      i tried and it didn't work. You didnt specify the type of regvar. even if you did, it still wouln't work. idk why

    • @johnemmanuel1426
      @johnemmanuel1426 5 лет назад +1

      It doesn't work m8.

    • @kazaamjt1901
      @kazaamjt1901 5 лет назад

      this tends to be slower, amongst other things

    • @cabreram.4734
      @cabreram.4734 5 лет назад

      Does or not work? Can't type now on my computer 🤔

  • @togmeister8604
    @togmeister8604 9 лет назад +23

    Dude, if you have programmed in other languages that's REALLLLLLLLY weird putting code between paremeters and start of statements.

    • @aggbak1
      @aggbak1 8 лет назад +2

      Ikr c++ is very quirky in this sense.

    • @modato97
      @modato97 6 лет назад +1

      thing is, if we are going to assign the values before the brackets, then why are they even there?

    • @Snugglelol
      @Snugglelol 6 лет назад

      Yeah even though that feature is there I always just put it in the brackets

    • @mikeym00zz
      @mikeym00zz 4 года назад

      reallllllly sounds weird... I prefer reaeaeaeaealy... wtf... that doesn't look right. aw fergetid

  • @MondAyyy
    @MondAyyy 11 лет назад +34

    watch , learn , forget

    • @theseangle
      @theseangle 4 года назад +4

      That's why you should watch only a few episodes a day and consolidate the lessons on your PC, in your Visual Studio/CodeBlocks, by yourself. And as we Russians say: repetition is mother of teaching.

    • @konstantinbachem9800
      @konstantinbachem9800 4 года назад +3

      This is the 45th tutorial i am watching today...

    • @riteshyeddu
      @riteshyeddu 4 года назад

      Hell yeah brother!

  • @YouShouldBeSpankful
    @YouShouldBeSpankful 12 лет назад

    When you type something with cout,instead of doing this:
    cout

  • @anshugoyal1447
    @anshugoyal1447 4 года назад +5

    How he used that private class member to print the output
    In one of his previos videos he said that we can't access the private class directly.but its working..help plz

    • @demonlord5635
      @demonlord5635 4 года назад +1

      he accessed that private class member by using a function which is also of the same class
      he then ran that function

    • @jaunathang
      @jaunathang 4 года назад

      You can manipulate private variables through functions of the same class! The constructor is one of those

    • @anshugoyal1447
      @anshugoyal1447 4 года назад

      @@jaunathang thansk for the intel

  • @TimelessPiano
    @TimelessPiano 12 лет назад

    At tutorial 45. Well I think everyone include myself has done pretty well getting this far. Can't wait for inheritance looked around at afew C++ game developing videos and you seem to need inheritance for alot of stuff.

  • @MattCrocco
    @MattCrocco 11 лет назад +1

    What makes this better than saying, for instance:
    Sally::Sally(int a, int b)
    {
    Sally::regVar = a;
    Sally::constVar = b; // Will throw an error I figured.
    }
    I will use member initializers since it allows you to initialize const variables but besides that whats the point?
    I can see maybe calling Sally::regVar is an issue as a reference to the entire class and not the object being initialized, an example of what I mean in Java is
    public Sally(int a, int b){
    Sally.a = a;
    Sally.b = b;
    }
    though in Java this is easily remedied with the "this" keyword which doesnt have the same function in C++.
    So is it simply as a safety measure and as a way to initialize any member variable at construction?

  • @alsenysylla5013
    @alsenysylla5013 9 лет назад +4

    Can someone please tell me why i get "No such file in the directory" when I try to run the program? I saved all files in the same place. when I was creating the class, I unchecked destructor and the visual thing and also unchecked relative path.

    • @shreyasrajapurkar3816
      @shreyasrajapurkar3816 9 лет назад

      Alseny Sylla i have been having the same error :/

    • @PhanHuynh7
      @PhanHuynh7 9 лет назад

      +Alseny Sylla check to see if #include "......h" not #include in your main.ccp

  • @MarijnKonings
    @MarijnKonings 11 лет назад

    It's mostly a matter of preference, go with what you think is the best.

  • @puffbluesam021
    @puffbluesam021 10 лет назад +5

    The two variable is inn the private part of the class but you don't need a function to set it and get it? Why? Is it because it called from the constructor?

    • @cbernier3
      @cbernier3 9 лет назад +2

      Matthew Sam Suren yes

  • @pavan5208
    @pavan5208 7 лет назад +4

    And guess what, you didn't hear a "pretty cool huh?!"in this tutorial. :P

  • @gemechubekele2546
    @gemechubekele2546 8 лет назад

    word wrap? use \ somewhere in your line and press enter. It helps you to continue your code on the next line without using another cout.

  • @Qazqi
    @Qazqi 11 лет назад

    What about references or built-in arrays? What about initializing objects that don't have a default constructor? What about an object that is expensive to default-construct, but that you just discard anyway when you assign to it in the body?

  • @janandanyoganadan616
    @janandanyoganadan616 4 года назад +1

    simple english.love it

  • @Qazqi
    @Qazqi 11 лет назад

    Before C++11, your source file had to end with a newline, so technically, the smallest valid program possible pre-C++11 is two lines.

  • @Majaroshimi
    @Majaroshimi 6 лет назад +1

    thanks men, you save my life.

  • @Aanshulofficial
    @Aanshulofficial 12 лет назад

    For Word Wrapping:
    Settings -> Editor -> Word Wrap checkbox
    You're free to go

  • @mariomodguy
    @mariomodguy 13 лет назад +1

    hey Bucky um can you tell me if your gonna make c++ game programming tutorials or if your gonna remake your java game programming tutorials?

  • @evanmastermind
    @evanmastermind 10 лет назад +19

    variabel

  • @PureT3x4n
    @PureT3x4n 13 лет назад +3

    Bang bang Sally, Sally bangs all day!
    Who we gunna bang on, when Sally goes away!?

  • @thenewboston
    @thenewboston  13 лет назад +4

    @MrHartl1ey a lot

  • @pisnahuj10
    @pisnahuj10 12 лет назад

    These series are the shiz ! brothumbs for u.

  • @dogtooth_gg
    @dogtooth_gg 7 лет назад +2

    Would it still work if I input:
    Sally::Sally(int a, int b) {
    regVar = a;
    constVar = b;
    }

  • @Nahiyan12
    @Nahiyan12 13 лет назад

    You can easily enable word wrap : Settings>Editor>Other Options(Legend)>Word Wrap...Simple enough?

  • @jeantonic9446
    @jeantonic9446 10 лет назад +2

    what about for vector or class arrays[] ??

    • @Simonkaabi
      @Simonkaabi 5 лет назад

      any idea how undestand what you said even in some video, need help !

  • @cabreram.4734
    @cabreram.4734 5 лет назад +1

    So, "Encapsulation" can be done with this then? I'm getting mixed up now!

  • @mjdhiru
    @mjdhiru 13 лет назад +1

    please answer any1..... when do we need to use this functins??????????

  • @laymonah1
    @laymonah1 12 лет назад

    thanks bucky you make c++ easyer and funn

  • @SAURAV1403406SAXENA
    @SAURAV1403406SAXENA 6 лет назад

    What if we want to do a type check before assigning value in constructor????

  • @akashpriyadarshi5612
    @akashpriyadarshi5612 6 лет назад

    At 5:52 , Bucky says that Sally so( )is a constructor but as i remember a constructor always has the same name as that of the class.Can anyone explain?

  • @mAcroFaze
    @mAcroFaze 13 лет назад

    Hi Bucky, first of all THANKS SO MUCH for your tutorials,
    i've just got a couple of questions regarding this tutorial, in the previous one you wrote 'const' at the end of the () in the sally.h file, but now you put it in the front of your variable, does that make any difference? And also, you only made one object, but it was able to reach both the regular and const variables, whereas in the previous tutorial you said u'd need a 'const' object to access const variables? please clarify? Thanks!:)

  • @EP_1990
    @EP_1990 9 лет назад

    When I create multiple object and pass different values to each objects in main function the value of constant variable is also modified which by definition should not. The two parameters which the object takes is an integer and a constant variable.
    Can someone explain? Thank you.

  • @Impulse_Photography
    @Impulse_Photography 3 года назад

    You don't need 'Word-Wrap' because you can just hit enter in the middle of a line, and continue the remaining code on the next line. C++ allows this.
    ex. ' cout

  • @dennischarlessmart9318
    @dennischarlessmart9318 8 лет назад +1

    Bucky, you inquired as to why the member initializer list goes between the right parentheses & the left curly brace? It's because that they - the other software language developers - hit me with the question so fast and furious and thus demanded an answer right away!
    So THE LORD had me respond with that particular position simply because there was no other convenient place to put it! Anywhere else, and that space was already taken - defined - and there simply wasn't any more key characters on the keyboard that would properly fit the situation at hand. So, the only logical conclusion that we came up with (in such short notice) was to place the member initializer list between the parenthetical statement and the curly brace statements declarator.
    Now, do you understand? Does it make sense? Can you come up with a better system? Think about it!
    Grace of God, Peace of Jesus Christ, and Love from,
    ~ The Holy Ghost

  • @divyagolyan
    @divyagolyan 6 лет назад +1

    I am constantly getting the error
    " In function main Undefined reference to 'Sally::Sally(int, int)' " since 2-3 videos
    Can someone help?

    • @theseangle
      @theseangle 4 года назад

      Google it 😉

    • @ainbrisk545
      @ainbrisk545 4 года назад

      Lol I would help but its been 2 years.

  • @CoDrenaline
    @CoDrenaline 11 лет назад

    Not sure what i'm doing wrong but I can't seem to be able to initialize strings this way. Somebody help?

  • @MrHartl1ey
    @MrHartl1ey 13 лет назад

    Bukky i love your videos but can you please tell me how many more c++ tuts you plan to do because i think they are the best.

  • @Tulanir1
    @Tulanir1 11 лет назад +1

    Bucky asked in the video if there was a way to word wrap...

  • @ayushkatoch5494
    @ayushkatoch5494 6 лет назад

    Cant we do it like this ?
    Sally :: Sally(int a , int b){
    regVar = a ;
    constVar = b;
    }
    Even here we are just intializing the variables, since Sally() is executed the moment an obj is created i dont think it will make a difference.

  • @georgegeorgiev4005
    @georgegeorgiev4005 10 лет назад

    Is it possible to use member initailizer in a derived class to initialize protected variable from the parent class?

  • @BasicPoke
    @BasicPoke 9 лет назад

    Bucky, just press enter and continue your line on the next line. The CR will have no effect.

  • @frankkeerssemeeckers6646
    @frankkeerssemeeckers6646 8 лет назад

    ITS probably gonna help people à lot to pic all THE Tuts handeling arrays And constants after Each other... I did anyways And iT helped pretty Well.

  • @Kevin-vz3uv
    @Kevin-vz3uv 9 лет назад

    this code not working for Visual Studio 2015, any help???

  • @sriharisridhar356
    @sriharisridhar356 7 лет назад

    Why cant initialize in the constructor??? like this..
    MyClass::MyClass(int a , int b){
    num=a;
    constnum=b;
    }

  • @HankGreenburg
    @HankGreenburg 12 лет назад

    Dangit... Mine won't work... Won't even compile now. Hate it when this happens cause it always takes so long to fix...

  • @vorty7923
    @vorty7923 10 лет назад +2

    Putitng something between parameters and the body?!?!? He is a wizzard!!!!

  • @Rigardoful
    @Rigardoful 13 лет назад

    @hbaderman Well .. Unless you learn much more you can't find much practical use to many things .. But it's also too early to do so.
    Although he didn't dive much into it, you can create new types of data(or variables I could say) with classes.
    Like strings, that's how they were made. And you'll see later they have function in them that you call like you call a class's functions.
    And I doubt he should start talking about binary trees, linked lists from now etc..

  • @onelerv1
    @onelerv1 13 лет назад

    To word rap =
    Settings->Editor...->General Settings->WordWrap
    Although I'm sure you've got it by now..

  • @samikshagupta78
    @samikshagupta78 4 года назад

    If we have to initialize a constant variable in a function, we do it this way or the normal one? Please help!

  • @OnTopOfDreams
    @OnTopOfDreams 11 лет назад

    what does the regular variable need to be included with the const variable when creating the function or constructor?

  • @treetoon-tf
    @treetoon-tf 12 лет назад

    The difference in assigning a variable in the member init vs in the actual constructor is almost none. You can assign it wherever you like really.
    There's only a difference if you create a const int i; without assigning a variable, this is legal c++ code as long as it is in a class. But this variable then has to be assigned in the constructor using the member init. If you create a const without assigning it in the member init you'll get an error. If you assign the const in the constr uget eror

  • @janisl.6982
    @janisl.6982 10 лет назад

    Is it for same reason as pass by refernce or something else,exepect that to it's in class

  • @nonpensarediesserlo
    @nonpensarediesserlo 10 лет назад

    Hi everyone,
    I am wondering what's the difference between a CONSTRUCTOR and a MEMBER INIZIALIZER... Is there someone that could explain that?
    Thanks

    • @ThineDarkSoldier
      @ThineDarkSoldier 10 лет назад

      nonpensarediesserlo
      A constructor is used when you are creating an object for a class. You're "initializing" your class for use.
      A member initializer is used to initialize individual variables for use within a function, in your class.
      Nax You explained it perfectly!
      nonpensarediesserlo I made a pastebin with everything Nax described:
      pastebin.com/2EFGgeyw
      Enjoy!

  • @zhikyang
    @zhikyang 12 лет назад

    Besides const variable, is there any other scenario that we have to use member initializer technique.

  • @Cyphlix
    @Cyphlix 11 лет назад

    why is it call member initializes instead of variable initializes? what would initializing a function look like?

  • @areola_ayatollah
    @areola_ayatollah 12 лет назад

    Bucky, you're a funny dude.

  • @mannyt814
    @mannyt814 8 лет назад +2

    Once I started programming, my spelling and typing went out the window... Does anyone else experience this? I think this is what Bucky is suffering from...

  • @quequequenananana
    @quequequenananana 12 лет назад

    But cant we assing them in the body of the constructor? Just like the normal way?

  • @creativeknowledgemike2337
    @creativeknowledgemike2337 7 лет назад

    did everything he said to doo and it say reg var and const var not declared.

  • @thodder9
    @thodder9 8 лет назад

    Can someone explain what the use of the double colon is in his *Sally.cpp tab where it says "Sally::Sally"?

    • @Jonathan-wo5eo
      @Jonathan-wo5eo 8 лет назад +1

      +Todd "Sally::Sally" means the constructor function "Sally" belongs to the class "Sally". This syntax is similar for defining other functions. For example, "Sally::print()" means the "print" function belongs to the "Sally" class.

    • @thodder9
      @thodder9 8 лет назад

      Makes sense now, thank you!

    • @aggbak1
      @aggbak1 8 лет назад

      It tells the program that hes working with the sally class.

  • @myloum
    @myloum 11 лет назад

    thank you so much! you saved my life :D

  • @tusharf5
    @tusharf5 10 лет назад +1

    How r you Accessing the variables that are in Private Class ?? Beginner

    • @NecroPhase1
      @NecroPhase1 10 лет назад +2

      One way in which to do this is to create 2 public functions. One of these will set the variable, the other one will get it.
      For example:
      int varGet() //Gets the variable from private
      {
      return var;
      }
      varSet(int x) //Sets the variable in private, allowing the value to be changed
      {
      var = x;
      }
      These would then be called in the program:
      int main() //In this case the number 5 should be the return value
      {
      Class object; //Create object of class
      object.varSet(5); //Set the variable "var" to 5
      object.varGet; //Return the value of "var", which should be 5
      }
      The private section can only be accessed by functions/methods of the same class, hopefully I made this some-what clearer for you.

    • @tusharf5
      @tusharf5 10 лет назад

      thanks

  • @apporvaarya
    @apporvaarya 4 года назад

    Just few more tutorials to go

  • @TheJaniczek
    @TheJaniczek 10 лет назад

    I'm getting an error constVar is not declared at this scope
    ||=== Build: Debug in new (compiler: GNU GCC Compiler) ===|
    C:\Users\xxxx\sally.cpp||In function 'void print()':|
    C:\Users\xxxxx\sally.cpp|11|error: 'regVar' was not declared in this scope|
    C:\Users\xxxxx\sally.cpp|12|error: 'constVar' was not declared in this scope|
    ||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
    can someone help me out ???

    • @TheEdoRan
      @TheEdoRan 10 лет назад

      did you defined the variables in the header file? and/or, did you included the header file in the source file?

    • @TheJaniczek
      @TheJaniczek 10 лет назад

      TheEdoRan Hi,
      need to re-do the whole thing one more time
      as far as i remember i done all exactly the same like in the vids
      Maybe my code::blocks config is all wrong

    • @TheJaniczek
      @TheJaniczek 10 лет назад

      TheEdoRan Hey :)
      don't know how but it started to work. i don't get it but as it seems I'm getting constant problems when I'm renoving the using namespace std;
      is it like recomended to use this ??
      seen lots of aps code without it.
      thanks

    • @TheJaniczek
      @TheJaniczek 9 лет назад

      +Ticomfreak cheers for that! Thanks

  • @rigzrk
    @rigzrk 7 лет назад

    Hello,
    Error is inside of main, and i create object:
    Mateo ma(4 ,50);
    ma.print();
    I get error at number 4 its say: cannot access private member declared in class 'Mateo'
    I just do as in video, just rename my variable and class.
    Can't find solution, help...

    • @rigzrk
      @rigzrk 7 лет назад

      Here:
      s23.postimg.org/8nmib4o8r/aaa.png
      It's,
      Mateo.cpp
      Void Mateo::Print(){
      ...
      }
      It's public

    • @bluewetball
      @bluewetball 7 лет назад

      look at the comment under you (if you haven't figured it out by now 9 months)

  • @Aanshulofficial
    @Aanshulofficial 12 лет назад

    Hey dood u said a lot more tuts but pleease tell me r u going to teach some more advanced stuff on c++

  • @khan.hassan
    @khan.hassan 7 лет назад

    I remember the last 30 seconds!

  • @amberwoodrow4597
    @amberwoodrow4597 9 лет назад +6

    cout

    • @rohanshahane4187
      @rohanshahane4187 7 лет назад

      You also need to put " \ " just before hitting the enter key so compiler ignores the newline(At least in my compiler). I know it too late but just saying.

  • @blindguysuckatgaming1376
    @blindguysuckatgaming1376 11 лет назад

    can someone tell me why i get an error that regVar hasn't been declared int his scope please guys help

  • @abhijeetckar
    @abhijeetckar 7 лет назад

    well explained!!

  • @ninehoursful
    @ninehoursful 13 лет назад

    @thenewboston Bucky will you do tutorials on Game development using c++..

  • @ashesrana
    @ashesrana 9 лет назад

    Where is the const function for the constVar?

  • @sumitstop1
    @sumitstop1 12 лет назад

    What is the difference between member initializer and a constructor ?

  • @Waranle
    @Waranle 13 лет назад

    Thank you Bucky, i hope you do Jquery after javascript tuts :)

  • @chrisownz1
    @chrisownz1 8 лет назад +1

    hmm.. why not just assign regvar = a?

    • @volikoto
      @volikoto 8 лет назад +4

      No problem with a regular variable, but with a constant variable you have to use the member initializer.

    • @tomerik8516
      @tomerik8516 6 лет назад

      volikoto but why? Whats the purpose with this rule?

  • @jintarokensei3308
    @jintarokensei3308 9 лет назад +1

    Is it still like that in C++14?

  • @hokahoka420
    @hokahoka420 8 лет назад

    You can just press enter after a "

  • @kylepoe5139
    @kylepoe5139 8 лет назад

    So a constant is a variable that isn't variable... got it

  • @glogalswaze
    @glogalswaze 12 лет назад

    check that you have
    void sally::print(){ .... or w/e method title you used...

  • @noisyether9211
    @noisyether9211 10 лет назад

    its not printing out and not picking up object so

  • @creativeknowledgemike2337
    @creativeknowledgemike2337 7 лет назад

    Just a question and what i think , I see this and then realize after all I've learned so far what the hell am I learning. What can I do with all this im looking for game design but i don't know the first thing?

    • @creativeknowledgemike2337
      @creativeknowledgemike2337 7 лет назад

      ***** simple console applicaitons all i learned too do was print out hi and i lvoe bacon and sally, i do appreciate the time this guy took out im still learning ,but When will i have the basic to actually do something what video helps me write acode to specific function for a game , or if i want to create my own private server an dcreate hacks for it just to b e able too to do that ,,and feel accomplished hey im pretty good. When do you get too use these functions , or what do these even mean CALL , RETN , JMP , JE stuff like that? Yes I know I have to understand all the stuff first thats why imma finish this , and move on to more c++ I just need a sense of i'm moving forward. Otherwise ill get discouraged , and feel like i'm not learning nothing and eventually quit.

    • @creativeknowledgemike2337
      @creativeknowledgemike2337 7 лет назад

      ***** I see , so i guess these tutorials are a waste of time.

  • @eddiepuccio1384
    @eddiepuccio1384 9 лет назад

    why did u have to pass reg var in and const var. Why couldn't you just set those variables equal to numbers.

  • @caspersecret
    @caspersecret 11 лет назад

    Worked with const int, but failed when I tried to pass "const string". Does this method work only for "const int" type?

  • @J0nDaFr3aK
    @J0nDaFr3aK 11 лет назад

    hey Bucky, your tutorials totally rock! I have a problem, though. everything works fine when I type the code in notepad++ then run g++ in cmd to compile it. When I use code blocks it gives me these errors: undefined reference to `Sally::Sally(int, int)' and undefined reference to `Sally::print()' it works with hellp world, but won't with this

    • @raz0229
      @raz0229 2 года назад +1

      You need to compile include both your header file and cpp file using g++ as:
      _ g++ Sally.cpp Sally.h main.cpp -o main_
      and then, run the _./main_ executable

    • @hetaeramancer
      @hetaeramancer 2 года назад

      @@raz0229 u dont have to include the slally,h, only the cally.cpp

    • @hetaeramancer
      @hetaeramancer 2 года назад

      @@raz0229 so it shoudl be like this
      g++ main.cpp Sally.cpp -o Sally.exe
      Sally.exe

  • @RitvikRaj301
    @RitvikRaj301 9 лет назад

    I'm okay with the initialization part. But later through the program if I need to access the variables, how i'm gonna do it? I think we need to create getnum() func. to achieve it. Correct me if I'm wrong. Is there any alternative? Beginner.

    • @sportacus509
      @sportacus509 9 лет назад +1

      Ritvik Raj Actually you're right you would make a getnum() and a setnum().

  • @johnlestermercado20
    @johnlestermercado20 9 лет назад

    What if you didn't make your classes in a different file. Only on your main file like on the earlier tutorial (Tutorial 13 to be exact), do you still need to list your members with that syntax for constant variables? Does it work for both single and multiple files?

    • @johnlestermercado20
      @johnlestermercado20 9 лет назад

      John Lester Mercado Well, I try it myself. It still need those member initializers. Without it, it has an error: uninitialized member.
      CODES:
      #include
      using namespace std;
      class Sally
      {
      public:
      Sally(int a, int b)
      : regVar(a), constVar(b)
      {
      }
      void print()
      {
      cout

  • @Genuigr
    @Genuigr 12 лет назад

    variabel is german ^-^ so technicly you're still right

  • @gavin8535
    @gavin8535 9 лет назад

    I followed every step of yours but just can not build and run............

    • @DrJoshification
      @DrJoshification 8 лет назад

      +Gavin Hoang It could be your compiler issue. Try deleting everything and start a new project. I faced the issue too.