Search:

Type: Posts; User: LPP

Search: Search took 0.00 seconds.

  1. Replies
    7
    Views
    1,813

    printf() uses a format string to get its...

    printf() uses a format string to get its arguments... I was just trying to get rid of any need for that.
  2. Replies
    7
    Views
    1,813

    Optional Function Parameters after ...

    Is this possible? I thought I had seen this sort of thing somewhere, but I can't find it or replicate it. This is my attempt:


    void example(int notimportant, ..., int terminator = 0)

    Thought...
  3. Replies
    16
    Views
    2,619

    I meant private as in hidden code-wise,...

    I meant private as in hidden code-wise, public-vs-private etc., and it's not working. I'll try the stuff again, but... -yawn-
  4. Replies
    16
    Views
    2,619

    Ok, so, when I said it all worked, now it's kinda...

    Ok, so, when I said it all worked, now it's kinda not. Because of it all being in the .cpp, for some reason, it is saying that every global variable in the .cpp (except for the templates) are...
  5. Replies
    16
    Views
    2,619

    Not at all. Linker Errors abound, for every...

    Not at all. Linker Errors abound, for every single call.

    However, having the main include the .cpp makes it all work!

    Now how can I keep those thing private that I want kept private?
  6. Replies
    16
    Views
    2,619

    Ok... following the articles' (which I read and...

    Ok... following the articles' (which I read and now fully understand) instructions, I "plunked" my template code into the .h and took it out from the .cpp

    The .h includes the .cpp, the .cpp...
  7. Replies
    16
    Views
    2,619

    Including the templated stuff I want kept...

    Including the templated stuff I want kept private? Also, what about stuff in the source referencing the templated functions and objects? There's a lot more code to this than I posted up...
  8. Replies
    16
    Views
    2,619

    Any combination of those doesn't work, unless I'm...

    Any combination of those doesn't work, unless I'm still not doing it right. Is there a sample? Just show me how to do it in relation to what I posted and I'll try it.
  9. Replies
    16
    Views
    2,619

    So, am I hearing that I should put the templates...

    So, am I hearing that I should put the templates in their own header file, or put them in a separate .cpp and include that, or that I should include the templated functions in the existing .h?
  10. Thread: va_list issues

    by LPP
    Replies
    10
    Views
    3,978

    Ahah! But the user specifies a single struct...

    Ahah! But the user specifies a single struct that contains all the data they need for the end function. It looks like I am going to have to do a bit of void* manipulation, but I'm not sure how it...
  11. Thread: va_list issues

    by LPP
    Replies
    10
    Views
    3,978

    I opted to try out templates... To see how that...

    I opted to try out templates... To see how that went (heh) check out my thread about the linker error. I'll try out the void* solution now, see how that goes... I'm optimistic, except for memory...
  12. Replies
    16
    Views
    2,619

    Linker Errors with Templates

    So, I'll just toss some example code at you to start:

    This is the struct and its constructor:


    template <class type_s> struct task {
    double time;
    void (*task)(type_s);
    type_s...
  13. Replies
    27
    Views
    1,911

    Thanks! iostream, huh? A little odd.

    Thanks! iostream, huh? A little odd.
  14. Replies
    27
    Views
    1,911

    Well, the problem that I'm having is in my header...

    Well, the problem that I'm having is in my header file... If I declare a function that takes an optional argument of NULL, it says NULL was not declared in this scope. What exactly does that mean?
  15. Replies
    27
    Views
    1,911

    Optional Function Parameters in Prototypes

    The name pretty much says it all. How do you do it, specifically in header files?
  16. Thread: va_list issues

    by LPP
    Replies
    10
    Views
    3,978

    Well, you've shown that I can't do it through...

    Well, you've shown that I can't do it through malloc, and I also can't use formatting strings or a null marker to signal the end of a va_list because I need to keep it in that form until it gets to...
  17. Thread: va_list issues

    by LPP
    Replies
    10
    Views
    3,978

    Another thing... Where should the va_end be...

    Another thing... Where should the va_end be called in my example (assuming there were no pointer issues)? Should it be called in the constructor, or in the end function?
  18. Replies
    5
    Views
    3,870

    Excellent! Thank you... I had never really...

    Excellent! Thank you... I had never really understood this. I already have several uses for this.
  19. Thread: va_list issues

    by LPP
    Replies
    10
    Views
    3,978

    So, a pointer issue... Would I be able to, say,...

    So, a pointer issue... Would I be able to, say, malloc arugments to keep that from happening? (Don't hurt me!)


    Can't have that... I need to allow the user to input a variable number of...
  20. Replies
    5
    Views
    3,870

    Typedef advantages?

    Just wondering if anyone has solid advice on when and how to use typedef.
  21. Thread: va_list issues

    by LPP
    Replies
    10
    Views
    3,978

    va_list issues

    So, I have a function that accepts a variable number of arguments and va_start's a va_list. It then creates a struct, assigns that va_list to one of the members, and then stores that struct...
  22. Replies
    7
    Views
    1,674

    And there is no option, other than va_arg? On...

    And there is no option, other than va_arg?

    On an entirely different note, can I create argument lists as variables and then pass them to a function, ie:



    void function(int a, int b){define...
  23. Replies
    7
    Views
    1,674

    Thanks very much! That was just a dumbed-down...

    Thanks very much! That was just a dumbed-down example of what I had. Ready for the next one?

    Can I have a function like so:



    void arg_func(...)

    Where I use the va_ functions to dissect...
  24. Replies
    7
    Views
    1,674

    Function Pointers in Structs and Classes?

    Is it possible to have function pointers in structs and classes? Here is the structure of the code I am trying to write:


    struct function_pointer
    {
    int id;
    int...
Results 1 to 24 of 25