Search:

Type: Posts; User: ch4

Page 1 of 7 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    637

    ok, i see. Thanks

    ok, i see.
    Thanks
  2. Replies
    4
    Views
    637

    But function is already friend.

    But function is already friend.
  3. Replies
    4
    Views
    637

    Access Inner's class member

    Hello fellows,

    I want to access protected member of inner class from within friend function of the outer class, without adding getter to inner class. Is that possible ? Any advice ?


    ...
  4. Replies
    11
    Views
    870

    It may be my confusion for years. I believed the...

    It may be my confusion for years. I believed the exact opposite. That is, i have to use underscore in front of, so as to avoid collision with reserved definitions. Thanks for the correct reminding.
    ...
  5. Replies
    11
    Views
    870

    But i have to admit that the compilation errors...

    But i have to admit that the compilation errors have lead me to another direction.
  6. Replies
    11
    Views
    870

    I have just found the solution. The ostream...

    I have just found the solution.

    The ostream couldn't find the way to print string. I've just included <string> and it does compile finally.

    I've removed const from player and then the error...
  7. Replies
    11
    Views
    870

    Thanks for the advices lasrlight. This code is...

    Thanks for the advices lasrlight.
    This code is not for bussiness. I was just helping someone and, while i was so sure that it does compile, i was surprised.

    The above is the minimal which is not...
  8. Replies
    11
    Views
    870

    Check attachements. 2 headers (one with the...

    Check attachements.

    2 headers (one with the problematic code)
    1 cpp with main.

    This minimal edition compiles and run on g++ (linux).

    I've tried on two different machines with VS 2015...
  9. Replies
    11
    Views
    870

    Yes, i do have code to test this function. Yes,...

    Yes, i do have code to test this function.
    Yes, i do have main.
    No i don't instantiate object of Player. Instead, i do instantiate subclasses of Player (such as GreedyPlayer) which are not abstract...
  10. Replies
    11
    Views
    870

    Error only on Visual Studio

    Hello fellows.
    I have tested the above code to g++ and it's ok. It does compile.


    class Player {
    private:
    string name;
    public:
    Player(const string &n)
    {
  11. Replies
    7
    Views
    1,680

    Sorting col_data by id would be cool. Otherwise,...

    Sorting col_data by id would be cool.
    Otherwise, searching for indexes in a meshed up col_data will lead to two nested loops.

    //Edit

    Thinking again, would you mind giving us more info about...
  12. That's why we don't have to care about the value...

    That's why we don't have to care about the value of NULL. Just use it as "NULL" Simple as pie.
    In reality i don't know if NULL is being used for other purposes except pointers. Not sure.
  13. NULL - C++ Reference...

    NULL - C++ Reference
    http://tigcc.ticalc.org/doc/alloc.html#NULL
  14. Replies
    7
    Views
    1,167

    I don't know why you're back still wondering...

    I don't know why you're back still wondering which programming language to choose. It seems that your thoughts drop you into endless loops such as while(1).
    So write a break; statement and pick C.
  15. Some advices without testing your code. 1. Do...

    Some advices without testing your code.
    1. Do not hijack the code with comments
    2. Use curly brackets to if-else statements. Only identation doesn't work. if/else without curly brackets nests a...
  16. 1. Here's the deal. As you propably know all...

    1. Here's the deal. As you propably know all pointers pointing somewhere in memory that's why are holding mysterious numbers. If you need a pointer to point to nowhere or you want to initialize it or...
  17. Thread: strcmp()

    by ch4
    Replies
    26
    Views
    1,787

    verifica it's a character, not an array of...

    verifica it's a character, not an array of characters.
    Try char verifica[200]; and check again arguments of strcmp.
  18. Replies
    9
    Views
    1,440

    The very fisrt step before add a node is to...

    The very fisrt step before add a node is to initialize the head/last pointers to NULL propably into main.
    Decide the way new items should be inserted to list. (Let's say at the end)
    In the...
  19. Replies
    9
    Views
    1,440

    Fix add function. Get a papper, draw (just some...

    Fix add function.
    Get a papper, draw (just some cubes + pseudoalgorithm) the list according to your add function and see what's going on.
    Then draw on papper the appropriate way.
  20. Replies
    7
    Views
    984

    1. You should name your variables in more...

    1. You should name your variables in more explainable way. (b,d = ???)
    2. one is pointer to pointer. one[0] is pointing to pointer. If one[0] isn't null (0) then has as value a memory address that's...
  21. Replies
    14
    Views
    1,423

    So, post your new version.

    So, post your new version.
  22. Replies
    14
    Views
    1,423

    Go to line 20 and remove semicolon. Placing...

    Go to line 20 and remove semicolon.
    Placing semicolon right after while(),means that loop and do nothing.

    I haven't read the rest but you may have issues when reading chars instead of ints. (line...
  23. Replies
    3
    Views
    1,623

    scanf is not working this way. Read more here...

    scanf is not working this way. Read more here.
    scanf differs from printf. Provide as argument a pointer to your variable (in reality address space). In you case &num1.

    scanf("%d", &num1);

    If...
  24. Thread: Polymorphism

    by ch4
    Replies
    4
    Views
    851

    It really doesn't make sense to me right now...

    It really doesn't make sense to me right now (more than two years away from oop), because i can't see reuseability.
  25. Thread: Polymorphism

    by ch4
    Replies
    4
    Views
    851

    I can't see the point of overriding (for example)...

    I can't see the point of overriding (for example) the getProtection() function in Weapon class.
    It can lead to chaos for deep inheritance.

    Anyway, thank you.
Results 1 to 25 of 156
Page 1 of 7 1 2 3 4