@11889music They are the way to access the arguments passed into your program from the command line. argc is the number of arguments passed and argv is the array of arguments separated by spaces. argv[0] is always the name of your prog (in this case argv[0] would be "game") and then the first actual arg would be argv[1], so I could have made it so that I could have passed the char name by command line. if(argc>1) me.setName(argv[1]); or something like that^^
Thank you, this is just what I've needed to get my motivation back for school. I've been in a sort of educational rut lately, but now with this video, I can 'see' that games are possible. And I have a better understanding of how to develop them. I was originally just here to get some more auditorial information on classes, but I found my motivation too.
You also did a great job with explaining everything. Now, back to homework....
No actually the #endif needs to be at the end of the definition/declaration or else you make have instances where you'll get errors about the double-def. because A.cpp includes both char.h and b.h but b.h also included char.h so when the complier brought all the code together if that #endif wasn't at the end of the file it would put the code for char.h in twice... which is the double-def error^_^
If this was designed for non-programmers then I doubt it will be understandable. Good video though; I learnt a lot. But shouldn't the '#endif' be right after the '#ifndef __CHAR_H__' and '#define __CHAR_H__'?
thank you for posting this, but do you know how to get the source code from a program, i am trying to see how people made a genetic algorithm for the traveling salesman problem, and i want to see the source code, can you help me? give me any tips or anything i would turly appreciate it
There are what are called disassemblers out there that you can use to disassemble compiled code into what is called assembly code and then you can translate that into c-pseudo code to make it easier to read. this is what we did for the broadcom driver, but it's been a while so you will have to google it, sorry. hope that was enough keywords to help you get started.
is it possible to pass a class to different functions?. Relating it to your video. If you have a function "createChar()" where you have character me to set the variables for me.getName() and all that kind of thing. but then when you go back to int main() its out of scope. Any help would be awesome.
Scope can be tricky. There are 3 ways to get around this. Pass an object of a class by reference to the function through its params, make a global object(above main()), and finally make the class what's called a singleton, this makes it so that there is only one instance possible of the class. I suggest passing a reference int createChar(character &instance){blah; return 0;} any changes to the passed object will still be there after returning
I was wondering how to pass a Class to a different function. Right now i have a few different Functions going on and the class appears to only have a scope in the function that i called it in. Hopefully that made some sense. Using this video as an example if you have a function called "int rolling()" to roll a character and then it goes and sets up the class for "me.function()" but then when we jump back to main and try to do "me.getName()" its not in scope anymore. Thanks!
man i watched all your tutorials and i almost wet my pants. I think i love you... can't wait for more tutorials especially on the ones for game creation.
In order to be readable here on youtube I kinda have to "play jazz" with concatenating, spacing, etc(style). Besides, seems like everyone likes there code a different way, so why should I worry about that instead of worrying about people reading and learning?^_^
Don't like Windows and while I could use VS in Linux, I don't like VS either. It's blotted and there are many IDEs out there that are better(emacs and geany are what I use, I'm getting better with emacs and liking it more all the time)
That being said, whatever floats your boat, more power to you. I use what I like and what I've found that works best for me. If you(and this goes for anyone)ever want to make the leap let me know. I'll do all I can to help.
And i'll just mention there are many IDEs that are crossplatform or even open source so you can use f.e. Code::Blocks or DevC++ on GNU/linux, mac or windows. And you also can use gcc or g++ on windows (this is what Code::Blocks does) and write your programs in notepad or any other text editor. The point is to know what you're doing so, VS might be good for start but soon you're going to relize it's really heavy and you don't need most of it's functions or those work better in other IDEs. Cheers.
I meant to say fltk 2.x is not too stable... fltk 1.1.7 is suposedly like a rock... and there is Equinox destop environment that uses eFLTK currently but they are backporting EDE to fltk 1.1.7 + libede to reduce dependancies so fltk is growing :-) also look up the fluid (an fltk gui creator that genrates c++ code) tutorials that are out there!
stfu n erd faggot get a new mic
Calamity117 10 months ago
you are person
Woddart 10 months ago
I miss that compiler!
Visual is so bland.
GeneticGhost 10 months ago
Jesus christ man take the fucking mic out of your throat.
Robertek02 1 year ago
int main(int argc, char* argv[])
Why do you have to specify those parameters for the main function?
What does that mean? I usually just do:
int main()
PS: Great music! I really like Massive Attack
11889music 1 year ago
@11889music They are the way to access the arguments passed into your program from the command line. argc is the number of arguments passed and argv is the array of arguments separated by spaces. argv[0] is always the name of your prog (in this case argv[0] would be "game") and then the first actual arg would be argv[1], so I could have made it so that I could have passed the char name by command line. if(argc>1) me.setName(argv[1]); or something like that^^
ryutenchi 1 year ago
massive attack \m/
msa1985 2 years ago
What flavour of Linux is that dude?
Interdiffusion 2 years ago
dude check your audio please before uploading ... you almost shredded my speakers!
TheSleepaholic 2 years ago
my ears too with headphones lol
g33k5 2 years ago
Thank you, this is just what I've needed to get my motivation back for school. I've been in a sort of educational rut lately, but now with this video, I can 'see' that games are possible. And I have a better understanding of how to develop them. I was originally just here to get some more auditorial information on classes, but I found my motivation too.
You also did a great job with explaining everything. Now, back to homework....
kewtkitty456 2 years ago
your gay
3815038 2 years ago
Neat video, I'm not really using classes yet, but your tutorial shed some light on what classes actually are.
CrazyTalkin 2 years ago
thanks so much man, you made classes so much easier to learn. Great Tutorial 5/5!
Sweemoo 3 years ago
No actually the #endif needs to be at the end of the definition/declaration or else you make have instances where you'll get errors about the double-def. because A.cpp includes both char.h and b.h but b.h also included char.h so when the complier brought all the code together if that #endif wasn't at the end of the file it would put the code for char.h in twice... which is the double-def error^_^
ryutenchi 3 years ago
If this was designed for non-programmers then I doubt it will be understandable. Good video though; I learnt a lot. But shouldn't the '#endif' be right after the '#ifndef __CHAR_H__' and '#define __CHAR_H__'?
SpareChaos 3 years ago
thank you for posting this, but do you know how to get the source code from a program, i am trying to see how people made a genetic algorithm for the traveling salesman problem, and i want to see the source code, can you help me? give me any tips or anything i would turly appreciate it
onlynumbersas 3 years ago
There are what are called disassemblers out there that you can use to disassemble compiled code into what is called assembly code and then you can translate that into c-pseudo code to make it easier to read. this is what we did for the broadcom driver, but it's been a while so you will have to google it, sorry. hope that was enough keywords to help you get started.
ryutenchi 3 years ago
this was real good, i cant xplain how much it helped..anyhow,u hav ntn on polymorphism? that seems pretty hard still
saddz 4 years ago
You repeat what protected is two times, but as I understand it, the first explanation is about private. And the second is about protected.
Or am I wrong?
GPadd 4 years ago
I may have meant private and said protected. I'll watch it again later and check^^
ryutenchi 4 years ago
you are correct, I do that sometimes. I'll make a note in the notes. Thank you for pointing that out^^
ryutenchi 4 years ago
I'm glad that I could help.
I like what you do, so.
That's the least I can do :-)
GPadd 4 years ago
is it possible to pass a class to different functions?. Relating it to your video. If you have a function "createChar()" where you have character me to set the variables for me.getName() and all that kind of thing. but then when you go back to int main() its out of scope. Any help would be awesome.
coreyj598123 4 years ago
sorry didnt realize i posted twice the first one didnt post for a while
coreyj598123 4 years ago
Scope can be tricky. There are 3 ways to get around this. Pass an object of a class by reference to the function through its params, make a global object(above main()), and finally make the class what's called a singleton, this makes it so that there is only one instance possible of the class. I suggest passing a reference int createChar(character &instance){blah; return 0;} any changes to the passed object will still be there after returning
ryutenchi 4 years ago
Thanks alot for the help
coreyj598123 4 years ago
I was wondering how to pass a Class to a different function. Right now i have a few different Functions going on and the class appears to only have a scope in the function that i called it in. Hopefully that made some sense. Using this video as an example if you have a function called "int rolling()" to roll a character and then it goes and sets up the class for "me.function()" but then when we jump back to main and try to do "me.getName()" its not in scope anymore. Thanks!
coreyj598123 4 years ago
man i watched all your tutorials and i almost wet my pants. I think i love you... can't wait for more tutorials especially on the ones for game creation.
omutomata 4 years ago
You could write your code better by making it more readable. (concatenating, spacing, etc (style))
vulgoremetal 4 years ago
In order to be readable here on youtube I kinda have to "play jazz" with concatenating, spacing, etc(style). Besides, seems like everyone likes there code a different way, so why should I worry about that instead of worrying about people reading and learning?^_^
ryutenchi 4 years ago
good
vulgoremetal 4 years ago
Thanks a lot for this dude, was really helpful - please make lots more vids!
p.s. why do u use linux to program? wouldn't something like visual studio be a lot less hassle?
tedflb 4 years ago
Always happy to help!
Don't like Windows and while I could use VS in Linux, I don't like VS either. It's blotted and there are many IDEs out there that are better(emacs and geany are what I use, I'm getting better with emacs and liking it more all the time)
That being said, whatever floats your boat, more power to you. I use what I like and what I've found that works best for me. If you(and this goes for anyone)ever want to make the leap let me know. I'll do all I can to help.
ryutenchi 4 years ago
And i'll just mention there are many IDEs that are crossplatform or even open source so you can use f.e. Code::Blocks or DevC++ on GNU/linux, mac or windows. And you also can use gcc or g++ on windows (this is what Code::Blocks does) and write your programs in notepad or any other text editor. The point is to know what you're doing so, VS might be good for start but soon you're going to relize it's really heavy and you don't need most of it's functions or those work better in other IDEs. Cheers.
cgofme 3 years ago
Good video as always, hope to see more on classes!
SyntaxandSemantics 4 years ago
So you could say "\n" is the equivalent to doing a page break in HTML.
AlmightBlackDragon 4 years ago
yes, it's the "newline" character
ryutenchi 4 years ago
Thanks for the tutorials...
If and when you do an openGL game could you use FLTK 1.1.7 to make the GUI? not FLTK since it is not really all that stable.
cusbrar1 4 years ago
never played with FLTK but I'll take a look at it and we'll see^_^
ryutenchi 4 years ago
thanks,
I meant to say fltk 2.x is not too stable... fltk 1.1.7 is suposedly like a rock... and there is Equinox destop environment that uses eFLTK currently but they are backporting EDE to fltk 1.1.7 + libede to reduce dependancies so fltk is growing :-) also look up the fluid (an fltk gui creator that genrates c++ code) tutorials that are out there!
cusbrar1 4 years ago