User Profile

Collapse

Profile Sidebar

Collapse
Nadeem Afroz
Nadeem Afroz
Last Activity: Sep 22 '08, 12:13 PM
Joined: Jan 10 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Nadeem Afroz
    replied to Template Pointer Type....
    in C
    ok let me know if u remember... thanx......
    See more | Go to post

    Leave a comment:


  • Nadeem Afroz
    replied to Template Pointer Type....
    in C
    Hello ... are u there ??...
    See more | Go to post

    Leave a comment:


  • Nadeem Afroz
    replied to Template Pointer Type....
    in C
    Hi ...

    I want to assign the address of variable i to ptr(template type) and then display the value using ptr... any idea how to do that ??...
    See more | Go to post

    Leave a comment:


  • Nadeem Afroz
    replied to Template Pointer Type....
    in C
    already went through this link ... didnt find anything related to this problem......
    See more | Go to post

    Leave a comment:


  • Nadeem Afroz
    replied to Run time function call problem
    in C
    Array of pointers to functions doesn't work here because the functions are of different types (arguments are of different types).... Please suggest any other way......
    See more | Go to post

    Leave a comment:


  • Nadeem Afroz
    replied to Template Pointer Type....
    in C
    Hello ....
    Can you just give me the syntax of how to do that ...
    i have created
    template <class T>
    T * ptr;

    main()
    {
    int i =10;
    //Here i want to assign the address of i to ptr & display value using ptr

    float j = 20.23;
    //here i want to assing the address of j to ptr & display value using ptr

    return 0;
    }...
    See more | Go to post

    Leave a comment:


  • Nadeem Afroz
    started a topic Template Pointer Type....
    in C

    Template Pointer Type....

    Hello Folks...

    Just going through the templates... found one good question worth sharing

    C++ allows the syntax type

    template <class T>
    T * ptr;

    can this ptr be used to point to types likes int variable or float variable

    ex: int i =10;
    ptr = &i;

    If this can be done plz share the syntax of doing it...
    Comments will be apprec...
    See more | Go to post

  • Nadeem Afroz
    started a topic Run time function call problem
    in C

    Run time function call problem

    Hello Folks!!!!!

    Here is a question ...

    I have two functions

    void fun1(int i )
    {
    printf("%d",i);
    }

    void fun2(float f)
    {
    printf("%f",f);
    }

    I want to call the fun1 if the user-input is 1 and fun2 if the user-input is 2
    I need to do this without using if-else, switch or conditonal operators... Any way to accomplish...
    See more | Go to post

  • As you can see in the example i need a generic pointer to member functions and not ordinary functions.... and its possible to have a pointer to member function which can point to the members functions with same return and argument list....

    example int (abc:: * ptr2fun1)();

    Here this ptr2fun1 can point to the member functions of class abc whose return type is int and paramet list is empty.

    But my question...
    See more | Go to post

    Leave a comment:


  • Nadeem Afroz
    started a topic Generic pointer to a member functions of a class
    in C

    Generic pointer to a member functions of a class

    Hello Folks!!!!
    i have one interesting question over here ..........


    Is it possible to create a generic pointer (generic pointer to member functions) which can point to all the member functions of a class

    Ex : [code=cpp]class abc()
    {

    int fun1(int a)
    {

    //Body of fun1
    }

    float fun2(float a)
    {

    //Body of fun2
    }...
    See more | Go to post
    Last edited by sicarie; Jan 10 '08, 06:07 PM. Reason: Code tags
No activity results to display
Show More
Working...