Search:

Type: Posts; User: ChayHawk

Search: Search took 0.01 seconds.

  1. And? I like having multiple perspectives, I often...

    And? I like having multiple perspectives, I often post on 3 or 4 different programming forums, I often find people on the same forum generally have a certain way of programming than others so the...
  2. Using a struct purely for variable documentation

    I am just writing and playing around with some code and I wanted to have a word represent a number in the parameter list of my class object, my numbers are ints but if i wanted to use a float then I...
  3. Thread: Virtual Help

    by ChayHawk
    Replies
    13
    Views
    580

    Sorry for the late reply, work and all that. I...

    Sorry for the late reply, work and all that. I decided to just make a new project and keep it simple, then make another project with a new concept using virtual. For this project it's just purely...
  4. Thread: Virtual Help

    by ChayHawk
    Replies
    13
    Views
    580

    So I have a question, heres my current code: ...

    So I have a question, heres my current code:


    #include <iostream>

    using namespace std;


    class VehiclePart
    {
  5. Thread: Virtual Help

    by ChayHawk
    Replies
    13
    Views
    580

    Yeah i'm just playing around and trying to...

    Yeah i'm just playing around and trying to understand virtual better, the concept of it is kind of hard for me to wrap my head around, and I just try to do the bare minimum of everything else and...
  6. Thread: Virtual Help

    by ChayHawk
    Replies
    13
    Views
    580

    I updated my code, I used a pure virtual...

    I updated my code, I used a pure virtual function, which I didnt want to do just yet but thats fine, it's just the one.


    #include <iostream>

    using namespace std;


    class Vehicle
    {
  7. Thread: Virtual Help

    by ChayHawk
    Replies
    13
    Views
    580

    Yeah I wasn't sure if it was "legal" to do but I...

    Yeah I wasn't sure if it was "legal" to do but I did it anyways and it worked, I figured not all vehicles have headlights, like a submarine or a boat so it didn't seem appropriate to put it in the...
  8. Thread: Virtual Help

    by ChayHawk
    Replies
    13
    Views
    580

    Thanks for the help guys. So I changed the code...

    Thanks for the help guys. So I changed the code and it works. I added a virtual destructor to my base class and destructors to my other classes.

    Here is the updated code:


    #include...
  9. Thread: Virtual Help

    by ChayHawk
    Replies
    13
    Views
    580

    Ah, I dont see any of those warnings. I just...

    Ah, I dont see any of those warnings. I just copied the code from here, near the top:

    Virtual Function in C++ - GeeksforGeeks

    The example worked and so I changed it to my own code. When I...
  10. Thread: Virtual Help

    by ChayHawk
    Replies
    13
    Views
    580

    Virtual Help

    So I am practicing virtual and I think im geting the hang of it. I was having trouble moreso with the concept of virtual and how it works than anything else but I just made a practice project, and I...
Results 1 to 10 of 10