Search Result

Collapse
5 results in 0.0040 seconds.
Keywords
Members
Tags
sizeof
  •  

  • Seismic
    started a topic boost dynamic_bitset block size issue
    in C

    boost dynamic_bitset block size issue

    I am designing an application in which I need to deal with many different variables in which different sequences of bits are stored. I have very strict memory requirements so I decided to use the boost::dynamic_ bitset data type which works very well in my scenario as I need to dynamically allocate/deallocate/resize the variables.

    The only problem is that I am not able to change the size of the blocks in which the dynamic_bitsets are...
    See more | Go to post

  • How to get memory usage of an adjacency list / transitive closure?

    Hi all,

    I'm using the BOOST libraries to compute an adjacency list and its transitive closure. I'm defining them as follows:
    Code:
    ...
    typedef boost::adjacency_list<> AdjacencyList;
    AdjacencyList g_transitiveClosure;
    AdjacencyList g_adjacencyList;
    ...
    What I'm doing is:
    loop start
    add edge information to the g_adjacencyList
    compute the transitive...
    See more | Go to post

  • mollwollfumble
    started a topic malloc for long long array?
    in C

    malloc for long long array?

    I'm a novice C programmer and am getting stuck on the insistence of malloc on using "size_t" for data array length. I want to use:
    Code:
    float *array
    long long int n
    array = malloc(n*sizeof(float))
    C insists on truncating my "long long int" to "size_t". So perhaps I have to redefine "size_t" or use an alternative to malloc. But how?
    See more | Go to post

  • How to initialize a structure variable to the size of the structure at compile time?

    I have seen this before and know it works (at least on an old Borland compiler). Unfortunately, though my memory is good, it's short. Using gcc how do I (can I?) initialize TESTSTRUCT.ssiz e to sizeof(TESTSTRU CT) at compile time?

    first data location counter = ??

    Code:
    typedef struct {
         int       ssize = x;        // The size of this structure
         long    lvar;
         short   svar;
    } TES
    ...
    See more | Go to post

  • sizeof(struct) giving unexpected sizes. Memory alignment issues?

    I noticed some quirks with C++ (not sure if this is the same for C).

    I have:

    Code:
    struct A {
        char a[14];
    };
    
    struct B {
        char b[16];
    };
    
    struct C {
        struct A a;
        struct B b;
    };
    sizeof(C) produces 32, which is mind boggling. Is the C++ compiler trying to align it to the memory structure? This is god awful for doing things...
    See more | Go to post
Working...