19 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for nathan.pavlovsky

Hello! I was creating a custom array class as an exercise in my exploring of class and function templates. Here's my header file: #include <iostream> template <typename el> class Array { friend std::ostream &operator<<(std::ostream&,const Array&); friend std::istream &operator>>(std::istream&,Array&); public: Array(const int& arraySize=0); //set all members of array with size arraySize …

Member Avatar for mike_2000_17
0
8K
Member Avatar for baig772

Hi Any one ever wrked on live helper chat? [This](http://livehelperchat.com/) This is following template structure may be symfony or smarty and I am looking to change some form labels, but cannot figure out where to chage? Thanks in advance for help

Member Avatar for baig772
0
213
Member Avatar for rajatchak

Hi all ...( warning : i am a total newbie to web development ) i am planning to develop a website... i have all the content to put into the website...and i already have a fanbase for the website. I have created the structure of the website in localhost. just …

Member Avatar for rajatchak
0
326
Member Avatar for abhimanipal

Hi Guys, I am trying to teach myself templates and I keep getting lost in all these compilation errors. Here is the latest // This is the interface for the base class template<class V, class I =int> class Array{ private: vector<V> myStore; public: Array(); Array(I size); Array(I size, V value); …

Member Avatar for abhimanipal
0
244
Member Avatar for abhimanipal

Hi Guys, I am trying to teach myself templates in C++. My current assignment is to create a matrix class by using vector of vectors. I have got most of it done but my code is crashing when I try to overload the random access operator in my matrix class. …

Member Avatar for deceptikon
0
438
Member Avatar for darkeclipse8

---------------------------------------------TSet.h------------------------------------------------------ #include <iostream> using namespace std; template <class V> class TSet { public: TSet(); TSet(int size); ~TSet(); void add(V new_item); void remove(V item_to_remove); int num_of_items(); bool isFull(); bool is_item_in_set(V item); friend bool operator==(const TSet<V>& left, const TSet<V>& right); friend bool operator!=(const TSet<V>& left, const TSet<V>& right); friend ostream& operator<<(ostream& outs,const …

0
151
Member Avatar for Secone

I have a template in a 1-file .h file, and I need it to be adjusted and modified to work properly with only a partial amount of the items in it used. The testArray.cpp file I include is how I test if it works properly. As it is now, it …

Member Avatar for Secone
0
183
Member Avatar for HunainHafeez

how much dynamic a template could be ? dynamic , in terms of modifications !! e.g i purchase a template for my website and further i want to modify it for my own satisfaction and requirements ? that how much it could be modified ? At large extent ? or …

Member Avatar for HunainHafeez
0
148
Member Avatar for abhimanipal

Hello everybody, I am trying to teach my stl and after writing some basic programs I have hit a road block. I have an iterator which I am trying to pass to a function template Here is my function template template <class T> void display(typename vector<T>::iterator start, typename vector<T>::iterator end){ …

Member Avatar for abhimanipal
0
172
Member Avatar for saucy6969

Hi there I am trying to center my website template to the middle of the page...currently at the left. Cant find which part of the CSS files it goes with...can anyone help? http://home.comcast.net/~waynetorrance/roomies/index.html

Member Avatar for JorgeM
0
175
Member Avatar for Quicxic

Hello, I have a problem with a header I'm trying to make. In Main.cpp, I have this function to store the combinations of the elements of vector S: [CODE=c++]template <class T> vector<vector<T> > combinations(vector<T> S, ll k) { vector<vector<ll> > combs = ncombinations(S.size(), k); vector<vector<T> > setcomb(combs.size(), vector<T>()); for(unsigned int …

Member Avatar for Quicxic
0
198
Member Avatar for u8sand

I programmed this vector class to support different types and different amount of dimensions. (class T,int D) D is the dimension. I don't use templates much and I'm running into an error, my constructors aren't working. Here is my class [CODE]#include <stdio.h> #include <stdarg.h> template <class T,int D> class Vector …

Member Avatar for mike_2000_17
0
245
Member Avatar for luislupe

I'm trying to build my first template function, but it generates a compile error when lines 21 and 22 are not commented. What I'm trying to do is to have a template function that can return multiset<int>, multiset<double> or multiset<string> depending on the attribute I want to extracto from the …

Member Avatar for mike_2000_17
0
314
Member Avatar for agarg12

What's wrong with this code.... //templates #include<iostream> using namespace std; template <class t> t max (t w,t x) [B][COLOR="Red"]--->here i get no error if I use &w and &x in place of w and x...[/COLOR][/B]{ if(w>x) return w; else if(w!=x) return x; } int main() { int a=10,b=343,c; c=max(a,b); cout<<"Max="<<c; …

Member Avatar for agarg12
0
131
Member Avatar for lasl0w

Hey all, I'm implementing a hash table for a spell checker and need some assistance on vector const_iterator - at least I think that's where the problem lies. Can anyone assist in diagnosing how to fix these compiler errors? I initially got this error, which i think will come back …

Member Avatar for lasl0w
0
439
Member Avatar for RobBobSmith

Hello all, I would be grateful for some help with a function template problem. I cannot figure out how to pass a matrix as an argument in a template function. I keep getting the error "does not match any template declaration". Can anyone suggest what my problem is? Have I …

Member Avatar for Fbody
0
183
Member Avatar for dohpaz42

In a nutshell I am trying to write a program that will connect to a database, query several tables for various sets of data that will then be transformed into XML that is stored into a file on the local hard disk. My first thought process to solve this problem …

Member Avatar for dohpaz42
0
194
Member Avatar for rootchord

Writing a function to search an array for a value and return the index if found. in finding what the size of the array is for use in the while loop condition i found that here inside the templated function sizeof(data) comes back as 4(it should be 40) but when …

Member Avatar for green_frog
0
496
Member Avatar for grib

I'm attempting to use a specialized function to search an array of c strings for the longest (or first tied for longest) member. Right now, I'm getting [inlinecode]line 87 error: invalid conversion from `char' to `const char*'|[/inlinecode] on my comparison statement. If I switch the templates' inputs to const, I …

Member Avatar for DavidRead
1
120

The End.