Search:

Type: Posts; User: thealmightyone

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Hi itsme86. Could I get you to try running the...

    Hi itsme86. Could I get you to try running the following code, and let me know if it seg faults. If not, can you post your gcc version ("gcc -v").

    [CODE]#include <stdio.h>
    #include <stdlib.h>
    ...
  2. Well, the code I posted is a summary of what...

    Well, the code I posted is a summary of what happens to variables related to the issue I had, thus I left out a LOT of code which I deemed to be unrelated.

    Interestingly, when I compile the code...
  3. Another 'dereferencing pointer to incomplete type'

    Essence of the code regarding issue:


    typedef struct BMS_Chkmem{
    int elemsize;
    } BMS_CHKMEM;

    typedef struct BMS_Blkmem{
    BMS_CHKMEM* chkmemhash[1013];
    } BMS_BLKMEM;
  4. Replies
    4
    Views
    2,145

    Thanks for the explanations John, it all make...

    Thanks for the explanations John, it all make sense now. Really appreciate it.
  5. Replies
    4
    Views
    2,145

    That fixed the compilation error. If there...

    That fixed the compilation error.

    If there aren't three declarations, but just one, then what does "(SCIP* scip, SCIP_READER* reader)" do, as it appears to contain two further variable...
  6. Replies
    4
    Views
    2,145

    C struct syntax query

    I've vastly simplified the struct definitions to minimise the size of the code, but the meaning is the same. The query is with the definition of SCIP_Reader.

    Once the macro define has been...
  7. Replies
    5
    Views
    2,754

    Gives me the same output as: Are you...

    Gives me the same output as:



    Are you referring to the use of -shared when compiling test.c, or when linking the objects? If test.c, then what would you suggest, as using that option is the...
  8. Replies
    5
    Views
    2,754

    Help me link to a .so

    I am trying to call one function in a .so which contains quite a lot of functions, but after having tried to get it working for days, am at a dead end. Using the nm command, the .so has a few...
  9. Replies
    3
    Views
    805

    Gotcha. Thanks all.

    Gotcha. Thanks all.
  10. Replies
    3
    Views
    805

    Array trouble

    Very simple code, but I have no idea why it won't compile. Compiler 'expected expression before '{' token'.



    #include <stdio.h>

    int particles[3][6];
    void new_particle(int);

    int...
  11. Replies
    26
    Views
    4,727

    Yeah, I began coming to the realisation that...

    Yeah, I began coming to the realisation that what I wanted to isn't actually possible (I'm always looking for small and elegant solutions). Got it all working with some for loops now.
  12. Replies
    26
    Views
    4,727

    Well spotted. Not fixed the code, but 1 step...

    Well spotted. Not fixed the code, but 1 step there. Should be &normArray[0], and function should be defined to return float*. I still can't get it to compile though, am getting 'excess elements in...
  13. Replies
    26
    Views
    4,727

    Oh, you think calcNormals returns an array of...

    Oh, you think calcNormals returns an array of size 9?

    Arrays point[0], [1] and [2] are fed INTO calcNormal (called by normals[x]), which returns pointer to normArray (size 3), which normals[x] is...
  14. Replies
    26
    Views
    4,727

    That question confuses me, so will answer best I...

    That question confuses me, so will answer best I can. I am passing 3 arrays, of size 3, into calcNormal. calcNormal is recieving the arrays correctly, as it is correctly calculating values. I have...
  15. Replies
    26
    Views
    4,727

    It does have a second dimension. Point[0] is...

    It does have a second dimension. Point[0] is (0,0,0)
  16. Replies
    26
    Views
    4,727

    I have done some more playing around, and the...

    I have done some more playing around, and the problem is actually still here, and the problem is when transferring the contents of normArray to normals.

    I had to make 'normals 2d', as if it is...
  17. Replies
    26
    Views
    4,727

    This is kinda embrassing. Printed out first...

    This is kinda embrassing.

    Printed out first member of normals, and it's fine. The problem seems to be with the calcNormal function, as the values aren't quite correct. Somehow got it into my head...
  18. Replies
    26
    Views
    4,727

    The code does compile if I don't include the line...

    The code does compile if I don't include the line in post #1 (which is not needed for program), but I'm pretty sure there's still a problem.

    When array 'normals' tries to set itself to the values...
  19. Replies
    26
    Views
    4,727

    The arrays B and T are of the form: ...

    The arrays B and T are of the form:



    T[8][3] = { {9.0, 4.6, -1.0}, etc}
    B[8][3] = { {4.5, 1.0, -10.0}, etc}


    If I decide to improve the code, I will localise stuff. For now, I just want to...
  20. Replies
    26
    Views
    4,727

    Post #3 answers your first question. To answer...

    Post #3 answers your first question.

    To answer your second question, I obviously can't use a local array, as the array would be lost when calcNormal ends. This is not the issue at all though.
  21. Replies
    26
    Views
    4,727

    Elysia, do you have any help for me?

    Elysia, do you have any help for me?
  22. Replies
    26
    Views
    4,727

    normArrays is a global array, not local....

    normArrays is a global array, not local.
    Probably worth clarifying that I don't want the contents of normals to point to normArray, but to be set to the values of normArray (set by the call to...
  23. Replies
    26
    Views
    4,727

    I do need to return a pointer/array of some sort,...

    I do need to return a pointer/array of some sort, due to its actual implementation:


    GLfloat normals[8][3] = {calcNormal(B[0], B[1], T[0]), calcNormal(B[1], B[2], T[1]),...}

    I tried your...
  24. Replies
    26
    Views
    4,727

    Help needed with pointing to arrays.

    I'm trying to write a function that takes as input 3 arrays, does some calculations, puts some values into a global array, then returns a pointer to that array.

    function is:


    GLfloat...
  25. I have simply replaced the for with a while, but...

    I have simply replaced the for with a while, but kept the '<=' as a personal preference. Code in first post updated.
Results 1 to 25 of 33
Page 1 of 2 1 2