Been working on a c++ project for school for the past few hours... I still hate the c language.... it's so unforgiving an ruthless <.<
Category All / All
Species Unspecified / Any
Size 793 x 485px
File Size 100.9 kB
Object-orient program. It's so glorious. I can make a custom object (or class) called say 'furry' and give it a bunch of functions and variables. Then, while programming, I can implement a new instance of that object as me (for example) like
chigaruJackal= new furry('Chigaru','Anubian Jackal','Male') //the function furry(name, species, male) is a constructor
and to manipulate the object I just do
chigaruJackal.changeName('Aerux') //the function changeName(newName) is built into the furry class and result in changing the variable 'name' in the furry object chigaruJackal to whatever newName is set as
or
chigaruJackal.changeSpecies('Side-striped Jackal') //the function changeSpecies(newSpecies) is like the previous function... just changes the spiecies
and then to get all the info I could do
chigaruJackal.getInfo()
and it'd print something like:
Name = Aerux
Species = Side-striped Jackal
Gender = Male
or before I used the changing functions:
Name = Chigaru
Species = Anubian Jackal
Gender = Male
you can do WAY more complex things than this, but that's a sample of how OOP works x3
chigaruJackal= new furry('Chigaru','Anubian Jackal','Male') //the function furry(name, species, male) is a constructor
and to manipulate the object I just do
chigaruJackal.changeName('Aerux') //the function changeName(newName) is built into the furry class and result in changing the variable 'name' in the furry object chigaruJackal to whatever newName is set as
or
chigaruJackal.changeSpecies('Side-striped Jackal') //the function changeSpecies(newSpecies) is like the previous function... just changes the spiecies
and then to get all the info I could do
chigaruJackal.getInfo()
and it'd print something like:
Name = Aerux
Species = Side-striped Jackal
Gender = Male
or before I used the changing functions:
Name = Chigaru
Species = Anubian Jackal
Gender = Male
you can do WAY more complex things than this, but that's a sample of how OOP works x3
FA+

Comments