Search:

Type: Posts; User: tempster09

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. There's already a design in place, we have...

    There's already a design in place, we have several classes and headers giving us thousands of lines of source code. I gave myself the requirement....it's my project, i simplified the problem to its...
  2. That's the problem, I don't know how to code a...

    That's the problem, I don't know how to code a solution since I have no idea how to approach it. I don't actually need a solution just a starting point maybe, like an idea of how to approach it. Or...
  3. Distribution of #'s across an array of sub groups

    What's the best distribution algorithm to use if I want to place numbers 1, 2, and 3 in an array. The array can be variable length and so can the number of occurrences of 1,2,and 3. The array is...
  4. Replies
    14
    Views
    5,809

    Thanks, I didn't really think it was possible to...

    Thanks, I didn't really think it was possible to do something like that in C but I forgot I have done things like your macro in the past. That's exactly what I was looking for. These functions will...
  5. Replies
    14
    Views
    5,809

    What's macro magic? This isn't a one time...

    What's macro magic? This isn't a one time solution, when we recompile under different circumstances we may have 4 functions today, 8 tomorrow, 3 the next day etc..It's the nature of the program,...
  6. Replies
    14
    Views
    5,809

    Dynamic array of function pointers

    Below is what I want to accomplish. These function pointers depend on how many functions I will be creating. They will always follow the pattern function1, function2, etc.. where it will be...
  7. Replies
    25
    Views
    2,063

    integer arrays

    is there a way to assign weights to indices in an array than use those to influence my choice? I want to write a function to randomly choose indices based on these weights (this way if there are 0...
  8. Conditional compilation and the preprocessor

    This questions is regarding conditional #define's. I was curious if I could use the pre-processor to figure out the value of a #define, or if in fact a #define is defined or undefined.

    example"
    ...
  9. Replies
    3
    Views
    1,354

    that's what i thought, but was hoping there was...

    that's what i thought, but was hoping there was another answer. That's too bad, i was even thinking of writing a function to do it for me but i would never know when to stop counting positions in an...
  10. Replies
    3
    Views
    1,354

    sizes of arrays within functions

    In C, i used a define when i first was learning which was something like:



    #define LENGTH(array) (sizeof(array)/sizeof(array[0]))


    or something along those lines in order to be able to...
  11. Replies
    4
    Views
    1,285

    void func1( int i ){} //pass by reference (can't...

    void func1( int i ){} //pass by reference (can't manipulate contents unless i is global
    void func2( int *i ){} //pass by address (manipulate contents of non-local variable

    int i;

    func1( i );...
  12. Replies
    3
    Views
    1,910

    Ya, just set your biggest number to 0, loop...

    Ya, just set your biggest number to 0, loop through all numbers saying if this number is bigger, set it to your current number. Than you only need one if statement (two if you do the smallest number...
  13. Replies
    2
    Views
    1,497

    Memory management

    What's the easiest (well not easiest), but best method for memory management if i'm allocating memory for structs, strings, arrays, etc.. Is there some way I could just store all the pointers in a...
  14. Replies
    15
    Views
    8,427

    Well i should have mentioned I exhausted all of...

    Well i should have mentioned I exhausted all of the simple options already, and can't use certain options. I would like to avoid the overhead of a function which allocates memory for a string,...
  15. Replies
    15
    Views
    8,427

    Thanks for enlightening me as opposed to helping...

    Thanks for enlightening me as opposed to helping me, i'll come up with something I guess. Thanks anyways. I mean why is it so difficult to give me a straight answer about grouping all three of...
  16. Replies
    15
    Views
    8,427

    No, essentially what's going on is this ...

    No, essentially what's going on is this



    main.c
    int main()
    {
    //call function in external file extern.c
    extern(__FILE__,__LINE__,__func__)
    }
  17. Replies
    15
    Views
    8,427

    Actually you are mistaken. __FILE__ is a string...

    Actually you are mistaken. __FILE__ is a string literal and can be concatenated, as I have done so with __FILE__ and __LINE__ by stringifying __LINE__. __FUNCTION__ aka __func__ is a treated as a...
  18. Replies
    15
    Views
    8,427

    concatenate 2 const char * problem

    This works:


    void myfunction( const char *file,const char *function, int index, int value )
    {
    // code
    }

    #define myfunction(...) myfunction( __FILE__, __func__, __VA_ARGS__ )
  19. Ya, my current compiler is at 4.xx as well. ...

    Ya, my current compiler is at 4.xx as well.

    RE:
    Basically, i guess i need a way to concatenate two const char *, because __func__ is a variable and Ive already got a string containing the LINE...
  20. don't rush, it's the holidays, don't make me a...

    don't rush, it's the holidays, don't make me a priority lol.

    I'm only working with GCC probably 3.0+, across linux platforms. I think __FUNCTION__ is supported by GCC and expanded to a string...
  21. Is stringification, ... (ellipsis), and...

    Is stringification, ... (ellipsis), and __FUNCTION__ C99 compliant? I don't want to be writing code thats gonna crap out across platforms.

    I can simply use __FUNCTION__ in my "ASSERT" define,...
  22. Well than how can I do it appropriately for...

    Well than how can I do it appropriately for non-windows platforms? I am currently using linux, it is for unix, and I would like it to be portable. How does assert do it?
  23. Re-Written Assert, can't get __FUNCTION__ or __func__ to work

    I have re-written assert to serve my own purpose. I want to hide debug implementation details from the "callers" using functions. Basically, a string parameter in my functions will be hidden from...
  24. Replies
    15
    Views
    2,892

    Yes, i'm afraid your not understanding me. I...

    Yes, i'm afraid your not understanding me. I need acurate and graceful/informational data failure in development and testing phase because the software is out of "my" hands and being tested or...
  25. Replies
    15
    Views
    2,892

    Using the debugger is a must regardless, I am...

    Using the debugger is a must regardless, I am just trying to make it easier for someone debugging to have a file and line to debug at. A function that is being called is external to the main area...
Results 1 to 25 of 48
Page 1 of 2 1 2