Search:

Type: Posts; User: Salem

Search: Search took 0.31 seconds.

  1. Replies
    24
    Views
    11,391

    > is there an alternative to (56), like a way to...

    > is there an alternative to (56), like a way to represent sizeof(struct) - sizeof(struct value).
    Well yes, sizeof(struct) - sizeof(struct value) should work, given the right things to do sizeof on.
  2. Replies
    24
    Views
    11,391

    Good - so you do have structs which don't contain...

    Good - so you do have structs which don't contain pointers.

    The first thing to look into is offsetof() which grumpy mentioned earlier. This will allow you to get to the field of interest in the...
  3. Replies
    24
    Views
    11,391

    @generaltso78 You need to post your actual...

    @generaltso78
    You need to post your actual struct, and the code you use to fwrite it to a file.
    Without it, it's impossible to tell whether any of your fseek / fread code makes any sense at all.
  4. Replies
    24
    Views
    11,391

    So exactly how are you serialising the struct...

    So exactly how are you serialising the struct then?

    If you have (as a result) variable length records because you're outputting variable length strings, then using fseek() to go to a particular...
  5. Replies
    24
    Views
    11,391

    > The struct holds various data char *, ints and...

    > The struct holds various data char *, ints and floats.
    Therein lies the problem.

    You can't just fwrite the contents of a struct, if it contains pointers.


    struct foo {
    char *a;
    } bar;...
Results 1 to 5 of 5