Search:

Type: Posts; User: CodeRed

Search: Search took 0.01 seconds.

  1. Replies
    17
    Views
    3,899

    That was very helpful, Andreas -- thanks!!

    That was very helpful, Andreas -- thanks!!
  2. Replies
    17
    Views
    3,899

    I have a follow-up question concerning my use of...

    I have a follow-up question concerning my use of 'char' as the return type for my fcn1Wrapper() call:

    my main code is similar to this, assuming that the function declaration was performed in the...
  3. Replies
    17
    Views
    3,899

    Ok, thanks for that clarification.

    Ok, thanks for that clarification.
  4. Replies
    17
    Views
    3,899

    Thanks for your advice, Codeplug; reverting to...

    Thanks for your advice, Codeplug; reverting to the original c-mex s-function code but just changing 'bool' to 'char', worked! The code now compiles and runs!

    Update: Fyi, I found that if I include...
  5. Replies
    17
    Views
    3,899

    Thanks for the clarification, grumpy; I was aware...

    Thanks for the clarification, grumpy; I was aware that bool isn't a C type, but wasn't sure how to go about correcting for this. I'll have to look at the C++ code more closely to determine how...
  6. Replies
    17
    Views
    3,899

    Thanks for the elucidation, Codeplug. To clarify,...

    Thanks for the elucidation, Codeplug. To clarify, I am using *gcc* to compile my *C* code. The functions that I want to access within my C code, are coded in C++, and saved in the .dll that I'm...
  7. Replies
    17
    Views
    3,899

    Thanks for your suggestion, iMalc; if I remove...

    Thanks for your suggestion, iMalc; if I remove "extern "C"", now my compiler errors are the following:

    line 33: error: expected declaration specifiers or '...' before '*' token

    line 33: error:...
  8. Replies
    17
    Views
    3,899

    Thanks for your clarification, christop. I had...

    Thanks for your clarification, christop. I had suspected that "extern C" isn't valid C syntax, but am not sure how to proceed. My source code is written in C++, compiled into a .dll using Visual...
  9. Replies
    17
    Views
    3,899

    Thanks for your suggestion, Codeplug. I tried it...

    Thanks for your suggestion, Codeplug. I tried it out, but unfortunately, I still receive the same exact compiler error ("expected identified or '(' before string constant"). Any other suggestions...
  10. Replies
    17
    Views
    3,899

    Problem with accessing DLL functions

    Hi!

    I’m attempting to translate currently-functional c-mex s-function code (from the Matlab platform) into regular C code. In that c-mex s-function code, the following sequence works to access...
  11. You were right, rags... I had missed that...

    You were right, rags... I had missed that fclose() was being called and *then* the conditional statement had been executing a second time. Problem solved, thanks for the suggestion.
  12. No, as I mentioned, the file pointers that I've...

    No, as I mentioned, the file pointers that I've tried are all valid (i.e. they can all be used successfully before & after this new conditional, but not within it). But thanks for the suggestion.
  13. In case it's useful: the new conditional...

    In case it's useful: the new conditional statement that's causing problems, was copied verbatim from an earlier code version that ran perfectly. I was careful to declare all variables & file pointers...
  14. fprintf() causes core dump when executed in certain sections of code

    I use fprintf() calls throughout a particular function. Most of them cause no problems & behave as expected. However, I've just added a conditional statement within this function, and any fprintf()...
  15. laserlight: No, I was referring to 2 separate...

    laserlight: No, I was referring to 2 separate entities -- the macro was one problem, and the int variable was a separate issue.

    Update: I resolved both of the problems that I described above! It...
  16. Thanks for your input. You're right, I created...

    Thanks for your input. You're right, I created some simple code, and my macro prints fine as an int. I also just discovered that another int value that I have, which only ever has the values of 0...
  17. What type are macros, for purposes of printing?

    I have a macro defined:

    #define MYMACRO 5

    and all I'm trying to do is print its value to the screen (I'm debugging and need to see all values that are part of a particular calculation). I've...
  18. Replies
    2
    Views
    1,000

    Thanks for the input, G. Sorry I forgot to...

    Thanks for the input, G. Sorry I forgot to include the fclose() in my pseudocode above; it *is* included in my real code. You're correct that the "%lf" was necessary to read in the double values -- I...
  19. Replies
    2
    Views
    1,000

    Problem with read-from-file process

    I’ve used the fscanf() function in the past with no problems, but for some reason, my current use of it in my C-mex s-function (Matlab-compatible C code) is causing problems. Below is a simplified...
  20. Replies
    5
    Views
    1,205

    Thanks for your input, everyone. I should have...

    Thanks for your input, everyone. I should have mentioned earlier that the rotaxis[][] array actually has the dimensions 5x3 (different than the other 4x4 arrays that I cited), so the for loop's j...
  21. Replies
    5
    Views
    1,205

    Logical flaw while handling 2D arrays

    I have some Matlab m-code that involves matrix operations, which I had to convert to C code. I’ve reviewed my code’s logic numerous times, and can’t yet find the logical flaw that’s preventing my C...
  22. Replies
    6
    Views
    1,504

    Thanks for your input. It looks like I'm going to...

    Thanks for your input. It looks like I'm going to have to simplify my own code and see where it's going wrong.
  23. Replies
    6
    Views
    1,504

    hmm, ok, I'll elaborate on my code, below....

    hmm, ok, I'll elaborate on my code, below. Thanks. (note: my code is a lot more extensive than what I've shown below, so it's not possible to include it all; but I have re-checked that I have...
  24. Replies
    6
    Views
    1,504

    myArray[i][j] = 0.0; //!! NOT [4][4] My...

    myArray[i][j] = 0.0; //!! NOT [4][4]

    My apologies, that was a typo... my real code does use the [i][j] array subscripts. Apart from that, do you see any problems?
  25. Replies
    6
    Views
    1,504

    Problem with passing 2D array by reference

    Hi! I have a 2D array that I need to pass to a function, have its value modified within that function, and then use the altered array within the original function.

    Here is a simplification of my...
Results 1 to 25 of 25