Search:

Type: Posts; User: micha_mondeli

Search: Search took 0.01 seconds.

  1. Replies
    10
    Views
    1,171

    No I haven't

    No I haven't
  2. Replies
    10
    Views
    1,171

    I'm trying to write a single template class whose...

    I'm trying to write a single template class whose instantiation with Foo<n>::result computes f(n) = 3^n - 2 ^ n at COMPILE TIME! Its a hw problem due in 30 minutes..THe hint given is how does f(n+1)...
  3. Replies
    10
    Views
    1,171

    Would this calculate the result at "compile time"...

    Would this calculate the result at "compile time" f(n) = 3 power(n) - 2power(n)..



    #include<iostream>
    using namespace std;


    template <class Foo>
    Foo Sub(Foo a)
  4. Replies
    10
    Views
    1,171

    HOw to convert to Template

    Hey guys i'm just wondering if someone could help me convert this to a template function...



    #include<iostream>
    #include<cmath>
    using namespace std;

    int main()
    {
  5. Replies
    3
    Views
    2,159

    Yes thats what i'm trying to do...derive a...

    Yes thats what i'm trying to do...derive a template vector sub-class that provides bound checking
  6. Replies
    7
    Views
    1,693

    Thanks a lot bluehead greatly appreciated but it...

    Thanks a lot bluehead greatly appreciated
    but it has to be in a template class so you can compute at compile time, and you have to instantiate with Foo<n>::result

    HOw does f(n+1) relate to f(n)?
  7. Replies
    3
    Views
    2,159

    Vector bounds check

    How would you write a Vector template class that checks the indexes passed to the [] operator to make sure they are correct....
    Inheritance??
    I have this so far



    template <class T> class...
  8. Replies
    7
    Views
    1,693

    Compile time Math

    Hey guys I'm wondering how I could convert this to one that computes 3^n - 2^n....that is 3 to the power n minus 2 to the power n.



    #include<iostream>
    using namespace std;

    template <int n>...
  9. Replies
    7
    Views
    1,649

    Actually hold up its working now! Strange..Thanks

    Actually hold up its working now! Strange..Thanks
  10. Replies
    7
    Views
    1,649

    Visual c++ 6.0

    Visual c++ 6.0
  11. Replies
    7
    Views
    1,649

    Template qsort

    Hi guys i'm wondering if someone could help me correct what i'm doing wrong ...my qsort code won't compile..Thanks



    template <typename T>
    void qsort(T *a, int l, int r) { // sort a[l..r]
    if...
  12. Replies
    5
    Views
    2,207

    Thanks google man

    Thanks google man
  13. Replies
    5
    Views
    2,207

    Hey I hope you are still there , I get it now I...

    Hey I hope you are still there , I get it now I solved it. Thanks
    Could you explain how the virtual function tabls are layed out??? I kinda wanna visualize it....but if not thanks problem solved
  14. Replies
    5
    Views
    2,207

    size of Object c++ compile problem

    Could someone please tell me why my main function is not compiling, and how (if you know how to use g++) would I find the size of objects X and Y? Thanks





    int main()
    {
    X *px = new X;
    }
  15. Replies
    5
    Views
    1,774

    would anyone like to implement this and test it...

    would anyone like to implement this and test it with ..



    #include <iostream>
    using namespace std;

    #include "CStringStack.h"

    CStringStack stack;
  16. Replies
    5
    Views
    1,131

    how would you implement the function to return...

    how would you implement the function to return the index of the largest element in an array with n elements?
  17. Replies
    5
    Views
    1,774

    implementing a stack with template

    How would you write a header file to implement a stack of const char* pointers using the above template class?? thanks guys



    #include <cassert>
    #include <stdlib>

    template<class Type> class...
  18. Replies
    5
    Views
    1,131

    c++ Templates

    template<typename T> int largest(T* myarray, int n)

    How would you write a program that uses the above template function to find the largest element in an int array and in a float array???...
Results 1 to 18 of 18