113 Topics

Member Avatar for
Member Avatar for spartanace

My file structure is Project data sort main.cpp code as follows [CODE]#include <cstdlib> #include <iostream> #include <fstream> #include <string> #include "genlist.cpp" #include "genstring.cpp" using namespace std; int main(int argc, char *argv[]) { ifstream in; ofstream out; int unique=0; GenList<string> gList; gList.checkFileOpen(in,out); gList.populateNUnique(in); gList.sort(1); gList.output(); in.close(); system("PAUSE"); return EXIT_SUCCESS; } [/CODE] …

Member Avatar for mrnutty
0
157
Member Avatar for dimios

Hi everyone, can you help me please with then following?? a)The C++ Standard Template Library (STL) contains a number of container data types, explain with suitable examples the advantages these give to the programmer over a procedural language such as C. b)Demonstrate using suitable code the usage of the STL …

Member Avatar for bandtank
0
216
Member Avatar for Blitz-labs.com

Hi All Im developing a website here's my situation. Im using one template and using template to link it to every page and using str_replace to replace parts of my site template for what is needed for each page. Any way my problem is this I have sidebar and in …

Member Avatar for Blitz-labs.com
0
165
Member Avatar for hotchkissChris

Hi, I'm reasonably new to C# and even newer to WPF projects in C#, i'm having a lot of trouble getting to grips with how to use the template property and its doing m head in. Firstly an explanation of what I am trying to achieve: I am working on …

Member Avatar for hotchkissChris
0
154
Member Avatar for maddav

Hi, just a quick question (i hope!!), i'm working on an assignment where i need to build a user-defined library of shapes. The class structure is to have "shape" as a base-class with both 2d and 3d shapes as derived classes. I've handled this by storing them in a vector …

Member Avatar for maddav
0
618
Member Avatar for madmax007

Hi, I want to develop a an application based on independent "CustomModule" that all derived from a base class "BaseModule" and that can send different kind of "CustomEvent" (derived from a "BaseModule" class) to each other. Each Module just knows that it is connected to others "BaseModule" (i.e. it does …

Member Avatar for madmax007
0
163
Member Avatar for trantran

This is likely a stupid question, but I can't figured out by myself how to pass a pointer to a member function of a templatised class in its own template parameters. More clearly: I would like to have this to work out: [code]template <typename T, T test::* PtrToMember> class test{ …

Member Avatar for trantran
1
555
Member Avatar for Ameix

I'll try to explain this the best I can. If I stop making sense, sorry. I downloaded a template from templatemonster.com and now am running into problems with the template. I understand how to edit and change pictures and text. My problem is I'm having trouble finding things. In the …

Member Avatar for keveenanderson
0
110
Member Avatar for o0mkh0o

Hello! Im having a problem with the following code structure. The code compiles without problems but when i start the program i get an "exception: __non_rtti_object at memory location...". In the constructor of the model-class i still can get the object information of the node-class through the base pointer. Once …

Member Avatar for o0mkh0o
0
321
Member Avatar for hkBattousai

[B]MyClass.h[/B][CODE]class MyClass { //... public: template <class T> static void Swap(T& Var1, T& Var2); //... }[/CODE] [B]MyClass.cpp[/B][CODE]template <class T> void MyClass::Swap( T& Var1, T& Var2 ) { Var1 ^= Var2; Var2 ^= Var1; Var1 ^= Var2; }[/CODE] In another file[CODE]#include "MyClass.h" //... int n = 40; int m = 60; …

Member Avatar for hkBattousai
0
2K
Member Avatar for dilas

I have such a problem: when I write:[code=c++] template<bool b> void foo(void); template<bool b> class B { friend void foo<b>(void); }; template<bool b> void foo(void){}; [/code] everything works just fine. But when I incapsulate all this in another class, I receive errors: [code=c++] struct C { template<bool b> void foo(void); …

Member Avatar for dilas
1
160
Member Avatar for puhzl

Hi, So I am currently working on a homework assignment for my data structures class, basically C++, and I am having some troubles converting a working c++ program to use a template. [code] #include <iostream> using namespace std; /* -------------------------------------------------------------------------- */ /* */ /* SECTION: DECLARATIONS */ /* */ /* …

Member Avatar for kvprajapati
0
588
Member Avatar for marc84
Member Avatar for virtuemart
0
244
Member Avatar for jakesee

Hi, I am playing around and trying to understand template singleton class and I accidentally created something that I am surprise it even runs. What I don't understand is when did Apple and Orange instances get created? Could you also comment on the good and bad of the Singleton class …

Member Avatar for jakesee
0
481
Member Avatar for flying_bird

Hi guys, The following code doesn't compile, and I've been banging my head why. Some header code: [code] template <typename T, typename LESS_THAN> class RestrictedSet { private : int _size; int _max_size; set<T, LESS_THAN> _S; typedef typename std::set<T, LESS_THAN>::iterator tIt; public : RestrictedSet (int max_size); RestrictedSet (RestrictedSet<T, LESS_THAN> &other); ~RestrictedSet …

Member Avatar for flying_bird
0
752
Member Avatar for cpp_fanatic

I have class A and class B: template<typename T> struct A { T data; ... }; template<typename T> struct B { T data; ... }; I can do the following: B<A<int> > b1; B<A<MyOtherType> > b2; But, these lines are so ugly and I want to make special type. I …

Member Avatar for Premlal
0
95
Member Avatar for denni2727

Well, I would like to know how can i print invoices in java. the page that my printer is using is like a type of template which has already written the fields(like name, address, id and so on). So, what i want to do is to print the data in …

Member Avatar for Ezzaral
0
142
Member Avatar for amanda110

Have you ever been thinking to make calendar by yourself? Use your own photo album as decorating picture and mark some special day with special tags rather than only red circle in the calendar. you will get the chance to [URL="http://www.imediacreator.com/tutorial-photo/use-calendar-template-to-make-calendar-on-mac.html#175"][B]use free calendar templates to make calendar on Mac[/B][/URL] for …

0
120
Member Avatar for TeckniX

So I created a template for a simple link builder function. Problem is, when I use it, I don't get the link, I get just the text. Could anyone help me understand what I'm doing wrong? Thanks! [CODE] <xsl:variable name="ReadMore"> <xsl:call-template name="linkBuilder" > <xsl:with-param name="linkID" select="format-number(@ID, '#,##0.#;-#,##0.#')" /> </xsl:call-template> </xsl:variable> …

0
139
Member Avatar for praveen_dusari

hi all, i am developing a newsletter module for my site,previously i used a specific newsletter added by admin (using wyswyg) and it is inserted in database and like that admin can send newsletter of his type to n number of users at a time. now i want to change …

Member Avatar for pritaeas
0
107
Member Avatar for yakovm

[CODE]#include<iostream> using namespace std; struct Base{ virtual void print(){cout << "Base"<< endl;} }; struct Derrived : Base{ void print(){cout << "Derrived"<< endl;} }; template< Base* arr,int size = 10> class Template{ public: void print(){arr->print();} };[/CODE] [CODE]#include "template.h" int main(){ Base *b = new Base(); Derrived *d = new Derrived(); Template<b> …

Member Avatar for mrnutty
0
113
Member Avatar for bil050

Hi, How can I define template formal parameter as T*? I read in some textbook that if I define template with formal parameter T* then actual parameter can be of the type T1*,provided that T1 is derived from T Thank you in advance

Member Avatar for mrnutty
0
99
Member Avatar for lancevo3

I am writing a method that does insertion into a doubly linked list and I was looking for some assistance with my code to see if I was heading in the write direction and what needs to be fixed to make this work. [B]Instructions[/B] template <class T> Iterator<T> List<T>::insert(Iterator<T> pos, …

Member Avatar for Protuberance
0
1K

The End.