This is weird, I typed exactly what Bucky did on my codeblocks but the compiler showed an error saying that "string" is not declared ?? How do I resolve this ?
Classes are easy, see: if fruits is a class, apple, banana, and orange are objects of the class fruits, apples are red, bananas are yellow and oranges are, well, orange. So the class fruits can have a string called color and you'd declare it like: "fruit apple("red"),banana("yellow");orange("orange"); :)
The fact that in the next video there is like 50% less views than this is probably because people had to watch this atleast 2 time in order to understand, or, the quitted here lol.
I got through every c++ video up until this one. it was a bit confusing, but what i got was by using objects they have their own variables rather than using universal variables.
and constructors are(contain) functions that that an(the) object calls when it is created.
If the compiler reads from top to bottom, then why didnt we get an error when we called the setName() function? We didnt declare it earlier neither we did a prototype so the compiler didnt know what it was. Mind Blown?
hey bucky :) i think that c++ would be easy for me but im onyl grade 8 and at our school programming is at grade 11/12 i really can understand this but should i stop learning it right now? and wait till grade 11? or should i learn it now cause i wanna learn a different language its called pawno its for san andreas multiplayer :) i really wanna learn it but would it be better if i just stick with c++?
@Carlocap11 Try to learn java/c++ now, those should set you up for many languages as the concepts are pretty much the same. If this is too tricky, have a look at visual basic - I started using it when I was 8 its a very good language for beginners.
@Carlocap11 Keep going, im in grade 9 and i started with Java, got through 60 tuts and made my own small program that took me about 8 hours to complete. Even after 60 vids, it wasnt confusing at all, because i understood. First 20 vids were like reading a whole chinese paragraph to me. Just keep going through them mindlessly and you will start to understand them. (I quit java because i want to make programs for IOS and android) Also Java is easier to understand.
So how do I get Code Blocks to show suggestions after I type a dot separator? I typed everything that Bucky did and I can't get it to show functions or variable names when I type a dot separator after my class object
Starting to get to the point where the stuff were learning could have some real uses in programming. I wish you had made a video around this point that would combine everything from the last 14 videos, and make a cool little program. That is why school helps you remember stuff better, is because the homework and projects etc. I guess I am going to have to think up a little "project for myself to do with everything ive learned so far.."
@moeezk7 You can use a GUI Library to code a GUI with measurements etc, it can get difficult but that's how most professional programs have such nice GUIs.
my head hurts should my head hurt. i mean your brilliant but being 12 means i just about get class's and objects and can make things like caculators but this is vodo
@Arihant65 some objects you make can't have default values.. for instance if you made a "person" class that contained a string for a name.. you need to have a name as soon as you create the object of a person.. you can't have a person without a name!
hi bucky , i know waht happend , i know from where the name came or exactly how you created it , first you've selected the variable name "name " then you hit on scroll button and automagicly you get an other copy !!!!!
A good example of classes and objects is Pokemon. Pokemon would be a class with a general set of attributes that a Pokemon would have and a specific Pokemon (Pikachu for instance) would be an object of the Pokemon class that has the Pokemon template but with a bunch of specific values that make Pikachu a unique Pokemon. Then you would have other Pokemon objects, Charmander, etc. objects with the same Pokemon template but with different values for the variables. Thumbs up so others can see.
@fwesh1 Close, but not really. A class is not an object; it's a template for creating an object. But until you create an object, it really doesn't exist in memory. Pokemon is an object. He exists in the game. And you can't use him to declare other Pokemons of his type!
@cmommsen1 I said that Pokemon could be a class and Pikachu or some other specific Pokemon could be an object of that class. A general Pokemon ( the template, the class) do not exist in game, specific Pokemon do.
@fwesh1 A good exercise in game development would be to make a simple text-based Pokemon game and write out the classes for each Pokemon creature! This is crazy, I just looked up Pokemon on Wikipedia and it has its own page with a list of 649 Pokemon species each one is a link to its own wikipedia page that explains its concepts, characteristics, origin, and reception. It's like it's own little sub-culture of Japanese delirium.. All I could think was wow, thank God I was born in the 80s!!
@cmommsen1 well pokemon now isnt what it used to be; the originals were all you really needed. Now its just about making more pokemon games, but trust me the time when Pokemon was good was the greatest. Yeah I'm not really looking to start the actual big games yet, I'm just using this example to help me and hopefully others visualize classes and objects and some uses by example.
No .. A class can have just one constructor. You can however have a "super" class that has a collection of sub-classes that all have their own constructor. For now you should stick with that. I am sure it will come into scope.
//So when you make the object it just makes it z and when you make the object you make the parameters like Lucky Bucky roberts so when you call the getname function it will just equal z?
@valid4ever Yes that is true, once you make the object and pass it a string, then the name will be that string. However, sometimes you may want to change the name in the middle of the program and so with the setName function, you can still change it.
i have problem bucky :) i wrote some small program based on your example, but i dont declare variables in my new object staticaly... i store them by user input.. now my problem is:
String somevar;
cin>>somevar;
it only stores one word, instead whole sentence . Im testing that as console aplication. is there a way to make string to store whole sentence? thanks in advance.
This is weird, I typed exactly what Bucky did on my codeblocks but the compiler showed an error saying that "string" is not declared ?? How do I resolve this ?
Timeslasher123 1 day ago
Le me taking le test in le c++
Question 1. What do you not want to do when creating constructors?
Answer: Write name in the middle of your program.....
TheFreedomSmurfs 4 days ago in playlist C++ Programming Tutorials Playlist
OK Bucky I saw you used a string in the constructor
Can I slap u in the Head???
munayata38 1 week ago in playlist C++ Tutorials
Classes are easy, see: if fruits is a class, apple, banana, and orange are objects of the class fruits, apples are red, bananas are yellow and oranges are, well, orange. So the class fruits can have a string called color and you'd declare it like: "fruit apple("red"),banana("yellow");orange("orange"); :)
Kapetozzo 2 weeks ago in playlist C++ Programming Tutorials Playlist
automatigicdbluworgwolbla lol
xatnu 2 weeks ago
Guys, Watch this Video ALL the times you think are necessary until you fully Understand.
I watched it and Replayed it about 20 times, Worth It!
MNiTwInInG 2 weeks ago in playlist C++ Programming Tutorials Playlist
Excellent Videos, Much Better than my Programming Professor
MNiTwInInG 2 weeks ago in playlist C++ Programming Tutorials Playlist
The fact that in the next video there is like 50% less views than this is probably because people had to watch this atleast 2 time in order to understand, or, the quitted here lol.
xXxDiukexXx 2 weeks ago
You are an idiot. You made the constructor print text out!
P0PP4R1 2 weeks ago in playlist C++ Programming Tutorials Playlist
buckY i m in love with ur tutorials..... awesome work.... :)
Saqib4742 3 weeks ago
I opened the program exactly when bucky did!
awesomelemonade 1 month ago in playlist Buckys C++ Programming Tutorials Playlist
Comment removed
MrTrolWut 1 month ago in playlist Buckys C++ Programming Tutorials Playlist
1 person prints out text in their constructors.
MrTrolWut 1 month ago in playlist Buckys C++ Programming Tutorials Playlist
slap.
BenjaminkAnderson 1 month ago in playlist More videos from thenewboston
I got through every c++ video up until this one. it was a bit confusing, but what i got was by using objects they have their own variables rather than using universal variables.
and constructors are(contain) functions that that an(the) object calls when it is created.
gocrazy432 1 month ago
4:37 WHERE DID THE };NAME BIT COME FROM?
CuristofaM 1 month ago in playlist More videos from thenewboston
Comment removed
arunansri 1 month ago
If the compiler reads from top to bottom, then why didnt we get an error when we called the setName() function? We didnt declare it earlier neither we did a prototype so the compiler didnt know what it was. Mind Blown?
LaughingShinoo 2 months ago in playlist Buckys C++ Programming Tutorials Playlist
@LaughingShinoo cause when you call the function it stop and run the function definition then it returns of not Void what ever value it has
soon34light 1 month ago
158 likes, 0 dislikes!
gudenaurock 2 months ago in playlist Buckys C++ Programming Tutorials Playlist
Ah. I'm so lost. Ever since we went into classes. :\
AAProdz 2 months ago in playlist Buckys C++ Programming Tutorials Playlist
@AAProdz Don't learn Java then. :-)
gudenaurock 2 months ago in playlist Buckys C++ Programming Tutorials Playlist
hi bucky, can we print without second object.?
kashif2050 2 months ago
111
kashif2050 2 months ago
hey bucky :) i think that c++ would be easy for me but im onyl grade 8 and at our school programming is at grade 11/12 i really can understand this but should i stop learning it right now? and wait till grade 11? or should i learn it now cause i wanna learn a different language its called pawno its for san andreas multiplayer :) i really wanna learn it but would it be better if i just stick with c++?
Carlocap11 3 months ago in playlist Buckys C++ Programming Tutorials Playlist
@Carlocap11 If Im in grade 9. If i were you, I'd learn java 1st, (bucky has java videos 2), and then learn C++. that's what i have done
Aaronster8 2 months ago
@Carlocap11 Try to learn java/c++ now, those should set you up for many languages as the concepts are pretty much the same. If this is too tricky, have a look at visual basic - I started using it when I was 8 its a very good language for beginners.
AJLogan1 2 months ago in playlist Buckys C++ Programming Tutorials Playlist
@Carlocap11 Keep going, im in grade 9 and i started with Java, got through 60 tuts and made my own small program that took me about 8 hours to complete. Even after 60 vids, it wasnt confusing at all, because i understood. First 20 vids were like reading a whole chinese paragraph to me. Just keep going through them mindlessly and you will start to understand them. (I quit java because i want to make programs for IOS and android) Also Java is easier to understand.
Player25223435234235 1 month ago in playlist Bucky's C++ Programming Tutorials
0 people have a bieber dick. :D
iHateMyLifeGr 3 months ago
2:09 was it "bla bla bla", or "blup blur".. im confused :P hehe
terfy 3 months ago in playlist C++ Programming Tutorials (thenewboston)
So how do I get Code Blocks to show suggestions after I type a dot separator? I typed everything that Bucky did and I can't get it to show functions or variable names when I type a dot separator after my class object
omfgimgonnadieee 3 months ago
@omfgimgonnadieee That's weird it should do that automagicalyl XD.. Uuh perhaps update to 10.05?
WindowsErrorFixer 3 months ago in playlist Buckys C++ Programming Tutorials Playlist
Amazing :) and looks like it would be usefull to optimize the code. hmm
Killer11Candy 3 months ago
Starting to get to the point where the stuff were learning could have some real uses in programming. I wish you had made a video around this point that would combine everything from the last 14 videos, and make a cool little program. That is why school helps you remember stuff better, is because the homework and projects etc. I guess I am going to have to think up a little "project for myself to do with everything ive learned so far.."
Thanks for making these videos!!
jbbauer0 4 months ago in playlist More videos from thenewboston
@jbbauer0 Thats a great idea.. I wanna see such too.. Show us your abilities mr Bucky
terfy 3 months ago in playlist C++ Programming Tutorials (thenewboston)
Comment removed
SuperSwatGuy 4 months ago
wtf all 2398 videos are made out of one person?
LanRous 4 months ago
@LanRous There are a couple people that post videos on it not just him
TheZebraMan100 4 months ago in playlist C++ Programming Tutorials (thenewboston)
press 2 for bucky's catch phrase
khodges72 4 months ago
its a funktion!!!
Ninjason1337 5 months ago in playlist C++ Tuts
@moeezk7 You can use a GUI Library to code a GUI with measurements etc, it can get difficult but that's how most professional programs have such nice GUIs.
XenoNetSec 5 months ago
oh and quiz's
eddrocks2 5 months ago
my head hurts should my head hurt. i mean your brilliant but being 12 means i just about get class's and objects and can make things like caculators but this is vodo
eddrocks2 5 months ago
keep clicking this ----> 4:45
swimtastik77 5 months ago
@moeezk7 well visual studio does all the gui stuff for you, buky is showing us the dead basics from a single source file
TehGameMaker 5 months ago
the name that was randomly in his program appeared from nowhere, 4:44 it wasnt there, 4:45 it was :o
gofish8195 6 months ago
@moeezk7 With difficulty
gofish8195 6 months ago
Wait, so you're an idiot and I should slap you upside the head? You printed from a constructor :P
thedanphillips 6 months ago in playlist TheNewBoston - C++
you talked the talk. now it's time to walk the walk.
NoneOfTheAbove312 6 months ago
it nice to learn how to know a write a letter and a word but how do I construct a sentence or a book with it?
the output is still the same as in tutorial 1 just a # OR "abc"
xetrius 6 months ago in playlist Bucky's C++ Programming Tutorials
*Slap Bucky* Don't use constructors to print out stuff on the screen!
MrSoddish 6 months ago in playlist Bucky's C++
*smacks you upside the head*
weswii 6 months ago
So all Constructor did for us was avoiding the 'SetData' function? I wish you had provided more examples on why it's used and necessary.
Arihant65 6 months ago
@Arihant65 some objects you make can't have default values.. for instance if you made a "person" class that contained a string for a name.. you need to have a name as soon as you create the object of a person.. you can't have a person without a name!
Electabuzz101 6 months ago
LOVE It !!!! Saved My C++ exam!!!
TheAyuclack 7 months ago
EXPLAINATION OF THE NAME THAT POPPED AT 4.45
hi bucky , i know waht happend , i know from where the name came or exactly how you created it , first you've selected the variable name "name " then you hit on scroll button and automagicly you get an other copy !!!!!
- keep it up
rizerzero 7 months ago
Rariyariya!!!!
eminemchu43 8 months ago
0:00 Free Video Replay.
eminemchu43 8 months ago 14
@eminemchu43 Thanks :P
stathar 1 month ago in playlist Buckys C++ Programming Tutorials Playlist
I always get anxious trying to imagine how the next string will sound...
Daggawaggaboof 8 months ago 2
So this would be useful quite useful with 3d objects.
Puffsmeal 8 months ago
A good example of classes and objects is Pokemon. Pokemon would be a class with a general set of attributes that a Pokemon would have and a specific Pokemon (Pikachu for instance) would be an object of the Pokemon class that has the Pokemon template but with a bunch of specific values that make Pikachu a unique Pokemon. Then you would have other Pokemon objects, Charmander, etc. objects with the same Pokemon template but with different values for the variables. Thumbs up so others can see.
fwesh1 9 months ago 49
@fwesh1 Close, but not really. A class is not an object; it's a template for creating an object. But until you create an object, it really doesn't exist in memory. Pokemon is an object. He exists in the game. And you can't use him to declare other Pokemons of his type!
cmommsen1 8 months ago
@cmommsen1 I said that Pokemon could be a class and Pikachu or some other specific Pokemon could be an object of that class. A general Pokemon ( the template, the class) do not exist in game, specific Pokemon do.
fwesh1 8 months ago
@fwesh1 Oh my bad, you were right. I only played Pokemon like once, and I thought he was that little yellow dude with red cheeks..
cmommsen1 8 months ago
@cmommsen1 lol its ok, just trying to help out those watching this video hoping for game development down the line
fwesh1 8 months ago
@fwesh1 A good exercise in game development would be to make a simple text-based Pokemon game and write out the classes for each Pokemon creature! This is crazy, I just looked up Pokemon on Wikipedia and it has its own page with a list of 649 Pokemon species each one is a link to its own wikipedia page that explains its concepts, characteristics, origin, and reception. It's like it's own little sub-culture of Japanese delirium.. All I could think was wow, thank God I was born in the 80s!!
cmommsen1 8 months ago
@cmommsen1 well pokemon now isnt what it used to be; the originals were all you really needed. Now its just about making more pokemon games, but trust me the time when Pokemon was good was the greatest. Yeah I'm not really looking to start the actual big games yet, I'm just using this example to help me and hopefully others visualize classes and objects and some uses by example.
fwesh1 8 months ago
hell of way to print out "Lucky Bucky roberts" :L
jakiesnakie1 9 months ago
How come that I can't set the name using string setName(string x){ name = x; } ?
I get this in my cmd:
Process returned -1073741819 (0xC0000005) execution time : 1.880 s
Press any key to continue.
1deividas1 9 months ago
@1deividas1 Have you check your flux capacitor to see if it's connected? If that doesn't work make sure your blinker fluid is topped off.
Fbiman93 9 months ago
i just cant understand return name;
ketceycon 9 months ago
@ketceycon It's pretty simple. "return name" just tells you what the variable "name" is holding.
AwesomeGamingGuy 9 months ago
so wait you're an idiot, cuz u printed something out in a constructor...if I find you I will slap u on the side of ur head.
DarKnSilenT 9 months ago
I'm starting to slow down these days, maybe it's because of the tons of editing I need to do to my master tutorial file to make everything workable.
TakingItCasual 9 months ago
Keep forgetting to add the parenthesis. =P Have error every time I run anything.
Vortex289 9 months ago
@Vortex289 at least you see where your going wrong
Djdaithik 9 months ago
@Djdaithik I am jsut as surprised at that as you are. =P
Vortex289 9 months ago
could a class have more than one constructor ? If yes, then how do you name it ?
Krisler12 9 months ago
@Krisler12
No .. A class can have just one constructor. You can however have a "super" class that has a collection of sub-classes that all have their own constructor. For now you should stick with that. I am sure it will come into scope.
djwave28 9 months ago
Very good explanation, thanks a lot.
AlexanderLee1 9 months ago
Your dope man! can you teach my teacher cuz i learned more in 30 min of watchin your vids than the whole first semester
GOOD JOB MAN KEEP UP THE GOOD WORK!
froy98 10 months ago
Quick Noob Question=}
Do you still need the setname function if you use
BuckyClass() { BuckyClass(string z) { name = z
//So when you make the object it just makes it z and when you make the object you make the parameters like Lucky Bucky roberts so when you call the getname function it will just equal z?
}
}
valid4ever 10 months ago
@valid4ever Yes that is true, once you make the object and pass it a string, then the name will be that string. However, sometimes you may want to change the name in the middle of the program and so with the setName function, you can still change it.
ItsVicc 9 months ago
Thumb down if you went back to see when he pasted 'name'
olivebates 10 months ago
Sally mcSalad. How do you come up with such awesome.
Vorbis5 10 months ago
lol with captions on , go to 1:10 : "Tasty rehearing" :P
D4L33tz0r 10 months ago
This has been flagged as spam show
int automagicalyl = blahblabla
bohterham 10 months ago
Lol you always say "I wanna stress that"
D4L33tz0r 10 months ago
what about destructor?
Jozekban 10 months ago
The "name" popped up at 4:45 :)
broadude 10 months ago 45
@broadude proof that bucky edits his videos, xD I though the didnt cut them O:
xXxDiukexXx 9 months ago
This has been flagged as spam show
@broadude proof that bucky edits his videos, xD I though he didnt cut them O:
xXxDiukexXx 9 months ago
i have problem bucky :) i wrote some small program based on your example, but i dont declare variables in my new object staticaly... i store them by user input.. now my problem is:
String somevar;
cin>>somevar;
it only stores one word, instead whole sentence . Im testing that as console aplication. is there a way to make string to store whole sentence? thanks in advance.
r4jk3 10 months ago
@r4jk3 Try using:
getline(cin, variable ); instead, i think that helps :)
XRaYNL 10 months ago
@XRaYNL yes i found that solution on the internet 1 hr ago :) and it worked, but thanks for reply :) hope it will help someone who reads this text :)
r4jk3 10 months ago
@XRaYNL return tuna;
Jozekban 10 months ago
Comment removed
r4jk3 10 months ago
automagicalyl
joaoris 10 months ago 82
@joaoris printied
natemcgraw 3 months ago in playlist Buckys C++ Programming Tutorials Playlist
Good tutorials. Thank you.
faiyaz786khan 11 months ago