Search:

Type: Posts; User: Adrian20XX

Search: Search took 0.00 seconds.

  1. I wanted to do this in order to clarify my...

    I wanted to do this in order to clarify my previous C code when porting it to C++.

    So, it's now in this way:

    template <class T> T max3bytemplate(T a, T b, T c);
    ...
  2. The one in Visual Studio C++, defined in stdlib.h...

    The one in Visual Studio C++, defined in stdlib.h

    Thanks, that's seemed to be a great pointer, I called it polymorphism but it seems it's a template.

    Would this be the proper way to do it?
    ...
  3. How to define a polymorphic function for numeric values

    Hi,

    Sorry for this question if it's too basic but I'm just a C programmer starting with C++, I want to define this polymorphic function __max3 to work for all the different types of numeric...
  4. Replies
    6
    Views
    3,691

    Fing unreal, have been stuck for almost a day...

    Fing unreal, have been stuck for almost a day with this :-)
    It was supposed to check for ==0 for a tie, not for !=0.
    So, it seems that it was my brain that was turned into a mashed potato, for...
  5. Replies
    6
    Views
    3,691

    Stupid problem

    Hi,
    I don't get what is happening with this code.


    // BEGIN DEBUG
    iNTies=0;
    printf("iNTies: %d\n", iNTies);
    if (iNTies!=0) {
    printf("Checked all players, player %d has winned",...
  6. I know the difference because of the position,...

    I know the difference because of the position, and the way this array is traversed.
    In case you are interested, it's an array for holdem evaluations, similar to the one that RayW posted in 2+2.
  7. It seems it's working, thanks!!!! It compiles...

    It seems it's working, thanks!!!!

    It compiles now the definition so I guess it works, but I still have to change tons of lines of code that have this as a non union array, and used typecasts...
  8. How to do a union that can have a pointer to this type of union

    Hi,

    I'd like to do a union that has a pointer to the same union.

    I've tried this:


    typedef union MyUnion_t {
    int value;
    MyUnion_t *next;
Results 1 to 8 of 8