No I haven't
Type: Posts; User: micha_mondeli
No I haven't
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)...
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)
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()
{
Yes thats what i'm trying to do...derive a template vector sub-class that provides bound checking
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)?
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...
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>...
Actually hold up its working now! Strange..Thanks
Visual c++ 6.0
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...
Thanks google man
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
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;
}
would anyone like to implement this and test it with ..
#include <iostream>
using namespace std;
#include "CStringStack.h"
CStringStack stack;
how would you implement the function to return the index of the largest element in an array with n elements?
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...
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???...