Search:

Type: Posts; User: Concorde

Search: Search took 0.00 seconds.

  1. Replies
    2
    Views
    1,607

    This is a good solution, Thank you!

    This is a good solution, Thank you!
  2. Replies
    2
    Views
    1,607

    Union of a struct

    I have this piece of code:


    #define NFIELDS 4

    typedef union
    {
    int Par[NFIELDS];
    struct {
    int Field1;
  3. Replies
    3
    Views
    2,288

    I have tried in C. In C++ is of course the same...

    I have tried in C. In C++ is of course the same because there are the operators overloading
  4. Replies
    3
    Views
    2,288

    Using atomic types

    In C is equivalent to use atomic types without calling atomic_load, atomic_store or atomic_fetch_add but using the standard C syntax of non atomic variables.

    These 2 pieces of codes are really...
  5. Replies
    3
    Views
    3,157

    I have solved in this way: #include...

    I have solved in this way:



    #include <stdatomic.h>

    typedef struct
    {
    atomic_ullong V[2];
    } vectoratomic_t;
  6. Replies
    3
    Views
    3,157

    Ok, this is the code for compiler explorer try...

    Ok, this is the code for compiler explorer try with flag -Weverything



    #include <stdatomic.h>


    typedef struct
    {
    atomic_ullong V[2];
  7. Replies
    3
    Views
    3,157

    clang warning: -Watomic-implicit-seq-cst

    I have this piece of code:



    atomic_int Vector[2];

    void Load(int *v)
    {
    v[0]=atomic_load(&Vector[0]);
    v[1]=atomic_load(&Vector[1]);
  8. Replies
    5
    Views
    5,693

    Thank you very much for your complete answer. So...

    Thank you very much for your complete answer. So for now I have:



    typedef atomic_bool TMutex;

    void MutexLock(TMutex *mutex)
    {
    while(atomic_flag_test_and_set(mutex));
    }
  9. Replies
    10
    Views
    7,956

    If you use a fixed size matrix you can use: ...

    If you use a fixed size matrix you can use:


    void how(int (*array)[421][70]){
    (*array)[420][69]=69;
    }
  10. Replies
    5
    Views
    5,693

    Thank you for the reply. The code works but I'm...

    Thank you for the reply. The code works but I'm not sure about the memory order of atomic_exchange and atomic_store that is memory_order_seq_cst. Is it correct for this kind of operations?
    With...
  11. Replies
    5
    Views
    5,693

    Mutex with atomics operations

    I want to build a low level mutex with atomic operations but I'm not sure if it's correct. It seems to work but I'm not sure with the memory order of atomic_exchange and atomic_store. Could you help...
  12. putting a random numbers generator in a class

    I'm learning c++ so it's a newbie question.

    I what to put a random generator in a class because it is only used by the class.
    To declare and to initialize a random numbers generator I use this...
  13. Replies
    4
    Views
    10,500

    sizeof for an extern array

    I have 2 files, one .cpp with an array of c strings


    char strings[][64]={
    "One",
    "Two",
    "Three"};


    in another .cpp file I have
  14. Replies
    5
    Views
    6,305

    Qt is not free. Does gtk have a forum for who...

    Qt is not free. Does gtk have a forum for who develop gtk applications?
  15. Replies
    5
    Views
    6,305

    Recommendations on gui library

    I need a C gui library that I can use under linux and windows with good documentation, examples and possibly a forum. What do you suggest?
Results 1 to 15 of 15