Results 1 to 2 of 2

Thread: c++ macro

  1. #1
    Cybernetic Interloper ub3r_n00b's Avatar
    Join Date
    Feb 2003
    Location
    Rivendel, East of The Ford of Bruinen
    Posts
    2,086

    c++ macro

    Hey guys, I am getting a segmentation fault using this macro (this is in C++):

    Code:
    // A parametric macro to allow the use of dynamic multi-dimensional arrays
    #define arr(arr,x,y,z,dim) *(arr + (z + dim[2]*(y + dim[1]*(x))))
    I am trying to convert this to a function

    Code:
      
    double arr(double* arr, int x, int y, int z, double* dim)
    {
      return *(arr + (z + dim[2]*(y + dim[1]*(x))));
    }

    Would this do the same thing?
    www.erudianart.com

  2. #2
    Cybernetic Interloper ub3r_n00b's Avatar
    Join Date
    Feb 2003
    Location
    Rivendel, East of The Ford of Bruinen
    Posts
    2,086
    So it works, issue was with something else.

    I hate converting c code that works on Windows to work in Linux Land.
    www.erudianart.com

Similar Threads

  1. Members' Cameras
    By Chris in forum Digital Media and Photography
    Replies: 65
    Last Post: 09-25-12, 10:19 PM
  2. macro recorder program
    By 24giovanni in forum Software Forum
    Replies: 2
    Last Post: 07-30-08, 12:38 AM
  3. Word Macro Help - Adding Help Text to Form Fields
    By KellyLynne in forum Programming Forum
    Replies: 0
    Last Post: 02-25-08, 07:44 AM
  4. Macro find highlight help
    By ilopezpena in forum Programming Forum
    Replies: 0
    Last Post: 02-16-07, 03:07 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •