Solved

CPP Class Queue (FIFO), Template Queue, Inheritance of Queue, Totally stuck

Posted on 2008-06-09
82
2,140 Views
Last Modified: 2013-12-14
Hi there,

i have to create within the next 24 hours a class Queue with a static array, typ int, change that to a queue template and last but not least inheritate the class Queue.

I"m totally stuck, because my class Queue does not work and therefore i cannot go on to the next task.
When i use the main and compile the ctor "QueueClass::queue1(0,0);" my compiler returns an undefined an undeclared reference to to "QueueClass::~QueueClass()


Please Help! Thanks a lot I Apreciate!
class QueueClass {

  int queue[SIZE];

      int head, tail;

public:

 

 QueueClass(int, int);

  ~QueueClass();

  
 

  void qu(int num);

  int dequ();

  int size();

  int isEmpty();

};
 

QueueClass::QueueClass (int a, int b) {

  head = a;

  tail = b;
 

}
 

void QueueClass::qu(int num)

{

  if(tail+1==head || (tail+1==SIZE && !head)) {

    cout << "Queue is full\n";

    return;

  }

  tail++;

  if(tail==SIZE) tail = 0; // cycle around

  queue[tail] = num;

}
 

int QueueClass::dequ()

{

  if(head == tail) {

    cout << "Queue is empty\n";

    return 0;                    // or some other error indicator

  }

  head++;

  if(head==SIZE) head = 0;       // cycle around

  return queue[head];

}
 

int QueueClass::size()

{

    int j=0;

  for (; j<tail; j++){

  }

  return j;

  }
 

 int QueueClass::isEmpty()

 {

    if(head == tail) {

    cout << "Queue is empty\n";

    return 1;

    }

    else return 0;

 }

Open in new window

0
Comment
Question by:george08
  • 42
  • 26
  • 9
82 Comments
 
LVL 4

Accepted Solution

by:
anmalaver earned 100 total points
ID: 21745785
Hi

You have not implemented your class contructor

QueueClass::~QueueClass () {}
0
 

Author Comment

by:george08
ID: 21745802
That it!

Thanks. What about the other questions? May you give a helping hand? I"m running out of time.

Thanks!
0
 
LVL 4

Expert Comment

by:anmalaver
ID: 21745877
Now i don't have my code.
I have a dynamic Queue class (not using arrays) implemented with templates, but i can post it until 8pm...
0
 

Author Comment

by:george08
ID: 21745893
that would be great. or can u help me to adapt my code from about to a template? i appreciate

0
 
LVL 4

Expert Comment

by:anmalaver
ID: 21745973
Yes, i think so, its very easy.

Maybe i get the code soon, and i will post it for u.

Bye
0
 

Author Comment

by:george08
ID: 21745984
thanks!
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21745988
>> You have not implemented your class contructor
>> QueueClass::~QueueClass () {}

That's a destructor :)

>> I have a dynamic Queue class (not using arrays) implemented with templates, but i can post it until 8pm...
@anmalaver, just a heads-up... I think this Q is related to homework... before you go posting full code you should check. It is against the EE rules on Academic Integrity to post full code solutions for homework. You should prefer to guide and educate in these circumstances.

http://www.experts-exchange.com/help.jsp#hi368
http://www.experts-exchange.com/help.jsp#hi21
http://www.experts-exchange.com/help.jsp#hi27 (3.4)

Good luck both of you.

-Rx.
0
 
LVL 4

Expert Comment

by:anmalaver
ID: 21746065
Thanx
0
 
LVL 40

Assisted Solution

by:evilrix
evilrix earned 400 total points
ID: 21746087
Here is a trivial example of converting a class from a type int to a template. You should be able to apply this to your design.

// int version
class IntQueue
{
   int m[100];
};

// Template
template <typename T>
class TQueue
{
   T m[100];
};

As you can see we've just declare the class TQueue as a template and substituted the int for the template type T, which is a place-holder for any type.

This is how you would then create an instance of both your original class vs. the new template class.

IntQueue intQueue1; // Non-template version
TQueue<int> intQueue2; // Non-template version

You'd inherit the classes like this...

// Non template inheritance
class DerivedIntQueue : public IntQueue
{
};

// Template inheritence
class DerivedTQueue : public TQueue<int>
{
};

More reading
http://www.cplusplus.com/doc/tutorial/inheritance.html
http://www.cplusplus.com/doc/tutorial/templates.html
0
 

Author Comment

by:george08
ID: 21746187
Im now on the Template... please help again

i attach the code snippets,
#include <iostream>

using namespace std;
 

#define SIZE 20
 

template <class t>

Class QueueClass

{
 

  int queue[SIZE];

      int head, tail;

public:

 

 QueueClass(int, int);

  ~QueueClass();

  
 

  void qu(int num);

  int dequ();

  int size();

  int isEmpty();

};
 

#include "QUEUET.H"

template &ltclass t>

b&ltt>:b()

QueueClass::QueueClass (int a, int b) {

  head = a;

  tail = b;
 

}
 

void QueueClass::qu(int num)

{

  if(tail+1==head || (tail+1==SIZE && !head)) {

    cout << "Queue is full\n";

    return;

  }

  tail++;

  if(tail==SIZE) tail = 0; // cycle around

  queue[tail] = num;

}
 

int QueueClass::dequ()

{

  if(head == tail) {

    cout << "Queue is empty\n";

    return 0;                    // or some other error indicator

  }

  head++;

  if(head==SIZE) head = 0;       // cycle around

  return queue[head];

}
 

int QueueClass::size()

{

    int j=0;

  for (; j<tail; j++){

  }

  return j;

  }
 

 int QueueClass::isEmpty()

 {

    if(head == tail) {

    cout << "Queue is empty\n";

    return 1;

    }

    else return 0;

 }

}
 

template &ltclass t>

b&ltt>::~QueueClass () {}

{

}
 

#include <iostream>

#include "queuet.cc"

using namespace std ;

int main()

{

	QueueClass<int> queue1 (1,1);
 

  

  
 

  cout<<"If 1, Queue is Empty, else 0 aka Queue is not empty. Result: " <<queue1.isEmpty()<<endl;

  int i;

  for(i=1; i <=10; i++) {

    queue1.qu(i);

  }

  cout<<"If 1, Queue is Empty, else 0 aka Queue is not empty. Result: " <<queue1.isEmpty()<<endl;

  cout<< queue1.size() <<" test" <<endl;
 

  for(i=1; i <=10; i++)

    cout << "Dequeue 1: " << queue1.dequ() << endl;
 

  return 0;

}

Open in new window

0
 
LVL 4

Expert Comment

by:anmalaver
ID: 21746220
I think that's enough, if you need more help just tell us, and don't forget to accept the answer.
0
 

Author Comment

by:george08
ID: 21746261
i accepted your answer, i did not knew the principle here. sorry.
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21746287
@george08,

You have accepted answer before your Q has been fully answered! You do not have to close a Q just because an expert tells you to. Experts shouldn't tell you to close a Q, you should close when you are ready.

Do you feel you have got all the answers you need from this Q? If so Can I point out that you answered 2 questions and the answer you selected only answers one of them. I was still quite prepared to help you with your template Q (I was 1/2 way through writing you an answer). Do you still require assistance with this? If so I am happy to carry on helping you but I would request you re-open the Q until such time as all your Qs have been answered and then you look to select all the answers that helped you.

I can see you are new to EE so I'm guessing you are not fully aware of the correct process to close a Q. Can I suggest you read the following and if you are still not sure then please ask.

http://www.experts-exchange.com/help.jsp#hi331

If you would like me to get this Q re-opened for you so we can continue helping you I am more than happy to do so.

-Rx.
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21746308
>> i accepted your answer, i did not knew the principle here. sorry.
You do not have to accept an answer because an expert tells you to.. experts shouldn't do that!

@anmalaver, you should tell an OP to close a Q. This Q was not finished and I was in the process of assisting. If you want a quick fix I suggest you go to a different site, this is not the site for you. This site is about helping others, not feeding your own ego.

@george08, based upon your last post I have requested this be reopened. Meanwhile I will continue assisting you until we have solved your problem... I will post again shortly
0
 

Author Comment

by:george08
ID: 21746319
thanks a lot! i appreciate a lot. thumbsup!
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21746373
Ok, I've requested the Q be reopened for you. It usually takes about 24 hours -- so watch this space. Meanwhile I will continue to assist you :)

>> Im now on the Template... please help again
Ok, you seem to be going in the right direction (although I'd change the t in the template declaration to be a T since it is normal to use uppercase and T is the conventional character used). You now need to go through the class and find all instances of type int and change them to be type T (remember, T is just a place holder for any time).

So, for example...

template <class T>
Class QueueClass
{

      //int queue[SIZE];
      T queue[SIZE];
      //int head, tail;
      T head, tail;
public:

      //QueueClass(int, int);
      QueueClass(T, T);
      ~QueueClass();

      ...
};


Don't forget to modify ALL functions that below to class Queue.
0
 

Author Comment

by:george08
ID: 21746461
This is the error of my queuet.h when i run the compiler... i do not have any clue

thanks!
#include <iostream>

using namespace std;

 

#define SIZE 20

 

template <class T>

Class QueueClass  //expected constructor, destroctor or type conversion before "QueueClass" //exptected ; before QueueClass

 

  T queue[SIZE];

      T head, tail;

public:

 

 QueueClass(T, T);

  ~QueueClass();

  

 

  void qu(T num);

  int dequ();

  T size();

  T isEmpty();

};

Open in new window

0
 
LVL 40

Expert Comment

by:evilrix
ID: 21746517
Look at the line you've identified... it contains an error.. I'll give you a hint, what's the difference between these two lines of code?

class foo{}; // This is correct
Class foo{};// This contains an error
0
 
LVL 4

Expert Comment

by:anmalaver
ID: 21746663
Don't forget opening brace:

template <class T> class QueueClass
{
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21746683
>> thanks a lot! i appreciate a lot. thumbsup!
Well spotted... I didn't see that... although, the next compiler error you'd have got once you fixed what I identified above would have told us :)
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21746688
I'll try again -- this time with the correct copy/paste buffer!

>> Don't forget opening brace:
Well spotted... I didn't see that... although, the next compiler error you'd have got once you fixed what I identified above would have told us :)
0
 
LVL 4

Expert Comment

by:anmalaver
ID: 21746708
Relax evilrix, i'm not here to fight...
Take a breath...
0
 

Author Comment

by:george08
ID: 21746721
thank you all

more to come, more answers needed :-) i marked the errors in the code, could not be so bad... but i'll learn a lot in these hours




#include "QUEUET.H"

template <class T>
 

QueueClass::QueueClass (T a, T b) { //error: clonficts with function deklsation template<class T> class QueueClass

  head = a; //undeclered, first use in function, me: declared in h, so within the scoop

  tail = b; //undeclered, first use in function
 

}

 

T QueueClass::qu(T num) //error template <class T? class QueueClass used without template parameters 

{  //exptected , or ; bevor { token

  if(tail+1==head || (tail+1==SIZE && !head)) {

    cout << "Queue is full\n";

    return;

  }

  tail++;

  if(tail==SIZE) tail = 0; 

  queue[tail] = num;

}

 

T QueueClass::dequ() //does not have a name type

{

  if(head == tail) {

    cout << "Queue is empty\n";

    return 0;                   

  }

  head++;

  if(head==SIZE) head = 0;       

  return queue[head];

}

 

T QueueClass::size() //does not have a name type

{

    T j=0;

  for (; j<tail; j++){

  }

  return j;

  }

 

 T QueueClass::isEmpty() //does not have a name type

 {

    if(head == tail) {

    cout << "Queue is empty\n";

    return 1;

    }

    else return 0;

 }

}

 
 

#include <iostream>

#include "queuet.cc"

using namespace std ;

int main()

{

        QueueClass<int> queue1 (1,1);

 

  

  

 

  cout<<"If 1, Queue is Empty, else 0 aka Queue is not empty. Result: " <<queue1.isEmpty()<<endl;

  int i;

  for(i=1; i <=10; i++) {

    queue1.qu(i);

  }

  cout<<"If 1, Queue is Empty, else 0 aka Queue is not empty. Result: " <<queue1.isEmpty()<<endl;

  cout<< queue1.size() <<" test" <<endl;

 

  for(i=1; i <=10; i++)

    cout << "Dequeue 1: " << queue1.dequ() << endl;

 

  return 0;

}

Open in new window

0
 
LVL 40

Expert Comment

by:evilrix
ID: 21746737
>> Relax evilrix, i'm not here to fight...
I just congratulated you, did I not? I was just pointing out we'd have got to that next, once the compiler did -- but well done for spotting it first.

>> Take a breath...
I did, whilst I counted to 10 slowly after your little performance above!

>> more to come, more answers needed :-) i marked the errors in the code, could not be so bad... but i'll learn a lot in these hours
I am going through your code now and annotating it with comments... watch this space...
0
 
LVL 4

Expert Comment

by:anmalaver
ID: 21746738
I don't know the reason, but when i did my class i had to add all the code on the .h...
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21746780
Ok, one this... all your class member functions need to be declared as template member functions...

template <typename T>
QueueClass::QueueClass (T a, T b)
{
}

template <typename T>
T QueueClass::qu(T num)
{
}


etc...
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21746795
oops... sorry, typo I'll try again....

Ok, one this... all your class member functions need to be declared as template member functions...

template <typename T>
QueueClass<T>::QueueClass (T a, T b)
{
}

template <typename T>
T QueueClass<T>::qu(T num)
{
}

etc...

I'll be posting back the full code shortly -- tested on a compiler to fix my typos :)
0
 
LVL 40

Assisted Solution

by:evilrix
evilrix earned 400 total points
ID: 21746853
Ok, the code below builds -- although I've not tested if it works.. I'll let you do that, this is your exercise :)

Note, it's currently headers and source together, you'll need to split it up appropriately.
#include "QUEUET.H" //<-- RX: Does this contain the class definition as per below?

//vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
 

// <--- RX: You need to have header guards

#ifndef QUEUET_H

#define QUEUET_H
 

#include <iostream>

using namespace std;

 

#define SIZE 20

 

template <class T>

//Class QueueClass <-- RX: Syntax error

class QueueClass

{ //<-- RX: Missing brace
 

  T queue[SIZE];

      T head, tail;

public:

 

 QueueClass(T, T);

  ~QueueClass();

  

 

  void qu(T num);

  //int dequ(); <-- RX: Should return T

  T dequ();

  T size();

  T isEmpty();

};
 

// <--- RX: You need to have header guards

#endif
 

//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

// <-- RX: I take it you ionclude this into your code where it is needed?

//         You know the compiler needs to see the full template defintion

//         at the Point Of Instantiation (POI) right? It is normally simpler

//         to implement all the template functions in the header, inine in

//         the class rather than seperately, otherwise it makes life harder.
 

template <class T>

//QueueClass::QueueClass (T a, T b) { //error: clonficts with function deklsation template<class T> class QueueClass

QueueClass<T>::QueueClass (T a, T b) { //<-- RX: The class is a template, the signature includes the template parameter(s)

	head = a; //undeclered, first use in function, me: declared in h, so within the scoop

	tail = b; //undeclered, first use in function
 

}
 

template <typename T> //<-- RX: You need to define this as a member template function so you need this!

//T QueueClass::qu(T num) //error template <class T? class QueueClass used without template parameters 

void QueueClass<T>::qu(T num)//<-- RX: The class is a template, the signature includes the template parameter(s) (this also returns void)

{  //exptected , or ; bevor { token

	if(tail+1==head || (tail+1==SIZE && !head)) {

		cout << "Queue is full\n";

		return;

	}

	tail++;

	if(tail==SIZE) tail = 0; 

	queue[tail] = num;

}
 

template <typename T> //<-- RX: You need to define this as a member template function so you need this!

//T QueueClass::dequ() //does not have a name type

T QueueClass<T>::dequ()//<-- RX: The class is a template, the signature includes the template parameter(s)

{

	if(head == tail) {

		cout << "Queue is empty\n";

		return 0;                   

	}

	head++;

	if(head==SIZE) head = 0;       

	return queue[head];

}
 

template <typename T> //<-- RX: You need to define this as a member template function so you need this!

//T QueueClass::size() //does not have a name type

T QueueClass<T>::size()//<-- RX: The class is a template, the signature includes the template parameter(s)

{

	T j=0;

	for (; j<tail; j++){

	}

	return j;

}
 

template <typename T> //<-- RX: You need to define this as a member template function so you need this!

//T QueueClass::isEmpty() //does not have a name type

T QueueClass<T>::isEmpty()//<-- RX: The class is a template, the signature includes the template parameter(s)

{

	if(head == tail) {

		cout << "Queue is empty\n";

		return 1;

	}

	else return 0;

}

//} <-- RX: Rogue brace
 
 

#include <iostream>

#include "queuet.cc"

using namespace std ;

int main()

{

	QueueClass<int> queue1 (1,1);
 
 
 
 

	cout<<"If 1, Queue is Empty, else 0 aka Queue is not empty. Result: " <<queue1.isEmpty()<<endl;

	int i;

	for(i=1; i <=10; i++) {

		queue1.qu(i);

	}

	cout<<"If 1, Queue is Empty, else 0 aka Queue is not empty. Result: " <<queue1.isEmpty()<<endl;

	cout<< queue1.size() <<" test" <<endl;
 

	for(i=1; i <=10; i++)

		cout << "Dequeue 1: " << queue1.dequ() << endl;
 

	return 0;

}

Open in new window

0
 
LVL 40

Assisted Solution

by:evilrix
evilrix earned 400 total points
ID: 21746906
>> I don't know the reason, but when i did my class i had to add all the code on the .h...

Ok, for both of you then...

This is because the compiler needs to see the full template definition at the Point Of Instantiation (POI). When a template is instantiated it is a 2 stage process. Firstly, the template is defined (this is the Point of Definition) without the dependent types (the template parameters) being defined and the template compiler checks the syntax of the code (without any type context). At the point where the template is instantiated to a concrete type (Point of Instantiation) the template compiler checks that the instantiated template is semantically correct in the context of all the dependent types and to do this it needs to be able to see the complete definition of the template. To this end, you need to include the code in every translation unit that uses the template and the simplest way to do this is to define the template as inline code in your class header, which is included everywhere you wish to use the template.

See my comment embedded in your code where I discuss this.

This is a good FAQ if you are interested in template programming.

http://womble.decadentplace.org.uk/c++/template-faq.html
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21746924
Oh, I forgot to mention that you can find my annotations in the code simply by searching for RX:

// <-- RX: All my comments always follow this format, so you an find them by looking for the leading 'RX'
0
 

Author Comment

by:george08
ID: 21746926
Hey, this link help! @evilrix

but i'm still stuck to a few problems i cannot figure out....

see the code snippets




template <class T>
 

QueueClass<T>::QueueClass (T a, T b) { 		//expected ; befor < token

	head = a; 

	tail = b; 				

 

}

 

template <typename T> 
 

void QueueClass<T>::qu(T num) 		//init declarator before < token //expected ; befor < token

{  

	if(tail+1==head || (tail+1==SIZE && !head)) {

		cout << "Queue is full\n";

		return;

	}

	tail++;

	if(tail==SIZE) tail = 0; 

	queue[tail] = num;

}

 

template <typename T> 
 

T QueueClass<T>::dequ()		//init declarator before < token //expected ; befor < token

{

	if(head == tail) {

		cout << "Queue is empty\n";

		return 0;                   

	}

	head++;

	if(head==SIZE) head = 0;       

	return queue[head];

}

 

template <typename T> 

T QueueClass<T>::size()

{ 							//init declarator before < token //expected ; befor < token

	T j=0;

	for (; j<tail; j++){

	}

	return j;

}

 

template <typename T> 
 

T QueueClass<T>::isEmpty()

{  				//init declarator before < token //expected ; befor < token

	if(head == tail) {

		cout << "Queue is empty\n";

		return 1;

	}

	else return 0;

}
 

///////////////////////
 

#include <iostream>

#include "queuet.cc"

using namespace std ;

int main()

{

	QueueClass<int> queue1 (1,1);  ////expected ; before int //QueueClass undeclared  //expect primary expression before int

 

	cout<<"If 1, Queue is Empty, else 0 aka Queue is not empty. Result: " <<queue1.isEmpty()<<endl;

	int i;

	for(i=1; i <=10; i++) {

		queue1.qu(i);        // queue1 undecleared, first use

	}

	cout<<"If 1, Queue is Empty, else 0 aka Queue is not empty. Result: " <<queue1.isEmpty()<<endl;

	cout<< queue1.size() <<" test" <<endl;

 

	for(i=1; i <=10; i++)

		cout << "Dequeue 1: " << queue1.dequ() << endl;

 

	return 0;

}

Open in new window

0
 
LVL 40

Expert Comment

by:evilrix
ID: 21746934
I suspect the error is before the code you posted, it looks like you have a missing semi-colon somewhere. The code I posted you built fine on VS2005... make sure you've split it up properly! did you try building it as it is (you'll have to comment out the includes that include your headers)?

BTW: What compiler are you using?

If you still can't resolve please post all the code.
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21746948
>> you'll have to comment out the includes that include your headers
Try copying and pasting ALL of this into one source file and building it... you should find it builds fine. If it does then carefully separate it up into the correct files and don't forget to uncomment the includes for the headers :)
//#include "QUEUET.H" //<-- RX: Does this contain the class definition as per below?

//vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
 

// <--- RX: You need to have header guards

#ifndef QUEUET_H

#define QUEUET_H
 

#include <iostream>

using namespace std;
 

#define SIZE 20
 

template <class T>

//Class QueueClass <-- RX: Syntax error

class QueueClass

{ //<-- RX: Missing brace
 

	T queue[SIZE];

	T head, tail;

public:
 

	QueueClass(T, T);

	~QueueClass(){};
 
 

	void qu(T num);

	//int dequ(); <-- RX: Should return T

	T dequ();

	T size();

	T isEmpty();

};
 

// <--- RX: You need to have header guards

#endif
 

//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

// <-- RX: I take it you ionclude this into your code where it is needed?

//         You know the compiler needs to see the full template defintion

//         at the Point Of Instantiation (POI) right? It is normally simpler

//         to implement all the template functions in the header, inine in

//         the class rather than seperately, otherwise it makes life harder.
 

template <class T>

//QueueClass::QueueClass (T a, T b) { //error: clonficts with function deklsation template<class T> class QueueClass

QueueClass<T>::QueueClass (T a, T b) { //<-- RX: The class is a template, the signature includes the template parameter(s)

	head = a; //undeclered, first use in function, me: declared in h, so within the scoop

	tail = b; //undeclered, first use in function
 

}
 

template <typename T> //<-- RX: You need to define this as a member template function so you need this!

//T QueueClass::qu(T num) //error template <class T? class QueueClass used without template parameters 

void QueueClass<T>::qu(T num)//<-- RX: The class is a template, the signature includes the template parameter(s) (this also returns void)

{  //exptected , or ; bevor { token

	if(tail+1==head || (tail+1==SIZE && !head)) {

		cout << "Queue is full\n";

		return;

	}

	tail++;

	if(tail==SIZE) tail = 0; 

	queue[tail] = num;

}
 

template <typename T> //<-- RX: You need to define this as a member template function so you need this!

//T QueueClass::dequ() //does not have a name type

T QueueClass<T>::dequ()//<-- RX: The class is a template, the signature includes the template parameter(s)

{

	if(head == tail) {

		cout << "Queue is empty\n";

		return 0;                   

	}

	head++;

	if(head==SIZE) head = 0;       

	return queue[head];

}
 

template <typename T> //<-- RX: You need to define this as a member template function so you need this!

//T QueueClass::size() //does not have a name type

T QueueClass<T>::size()//<-- RX: The class is a template, the signature includes the template parameter(s)

{

	T j=0;

	for (; j<tail; j++){

	}

	return j;

}
 

template <typename T> //<-- RX: You need to define this as a member template function so you need this!

//T QueueClass::isEmpty() //does not have a name type

T QueueClass<T>::isEmpty()//<-- RX: The class is a template, the signature includes the template parameter(s)

{

	if(head == tail) {

		cout << "Queue is empty\n";

		return 1;

	}

	else return 0;

}

//} <-- RX: Rogue brace
 
 

#include <iostream>

//#include "queuet.cc"

using namespace std ;

int main()

{

	QueueClass<int> queue1 (1,1);
 
 
 
 

	cout<<"If 1, Queue is Empty, else 0 aka Queue is not empty. Result: " <<queue1.isEmpty()<<endl;

	int i;

	for(i=1; i <=10; i++) {

		queue1.qu(i);

	}

	cout<<"If 1, Queue is Empty, else 0 aka Queue is not empty. Result: " <<queue1.isEmpty()<<endl;

	cout<< queue1.size() <<" test" <<endl;
 

	for(i=1; i <=10; i++)

		cout << "Dequeue 1: " << queue1.dequ() << endl;
 

	return 0;

}

Open in new window

0
 
LVL 40

Expert Comment

by:evilrix
ID: 21746954
BTW: I'm real sorry but I will have to go to bed in about 5 minutes, work in about 6 hours :(
0
 

Author Comment

by:george08
ID: 21746961
I'm using a gnu with the command line under windows xp

i have no more clue, i'm posting my whole code, which, i might add worked bevor i went over to the template business


thanx!

///////////////my queuet.h

#ifndef QUEUET_H

#define QUEUET_H

 

#include <iostream>

using namespace std;

 

#define SIZE 20

 

template <class T>
 

class QueueClass

{ 

 

  T queue[SIZE];

      T head, tail;

public:

 

 QueueClass(T, T);

  ~QueueClass();

  

 

  void qu(T num);

 

  T dequ();

  T size();

  T isEmpty();

};
 

#endif
 

////////////////////////////////my queuet.cc
 
 

template <class T>
 

QueueClass<T>::QueueClass (T a, T b) { 		//expected ; befor < token

	head = a; 

	tail = b; 				

 

}

 

template <typename T> 
 

void QueueClass<T>::qu(T num) 		//init declarator before < token //expected ; befor < token

{  

	if(tail+1==head || (tail+1==SIZE && !head)) {

		cout << "Queue is full\n";

		return;

	}

	tail++;

	if(tail==SIZE) tail = 0; 

	queue[tail] = num;

}

 

template <typename T> 
 

T QueueClass<T>::dequ()		//init declarator before < token //expected ; befor < token

{

	if(head == tail) {

		cout << "Queue is empty\n";

		return 0;                   

	}

	head++;

	if(head==SIZE) head = 0;       

	return queue[head];

}

 

template <typename T> 

T QueueClass<T>::size()

{ 							//init declarator before < token //expected ; befor < token

	T j=0;

	for (; j<tail; j++){

	}

	return j;

}

 

template <typename T> 
 

T QueueClass<T>::isEmpty()

{  				//init declarator before < token //expected ; befor < token

	if(head == tail) {

		cout << "Queue is empty\n";

		return 1;

	}

	else return 0;

}
 

/////////////////////////////my main.cc
 

#include <iostream>

#include "queuet.cc"

using namespace std ;

int main()

{

	QueueClass<int> queue1 (1,1);  ////expected ; before int //QueueClass undeclared  //expect primary expression before int

 

	cout<<"If 1, Queue is Empty, else 0 aka Queue is not empty. Result: " <<queue1.isEmpty()<<endl;

	int i;

	for(i=1; i <=10; i++) {

		queue1.qu(i);        // queue1 undecleared, first use

	}

	cout<<"If 1, Queue is Empty, else 0 aka Queue is not empty. Result: " <<queue1.isEmpty()<<endl;

	cout<< queue1.size() <<" test" <<endl;

 

	for(i=1; i <=10; i++)

		cout << "Dequeue 1: " << queue1.dequ() << endl;

 

	return 0;

}

Open in new window

0
 
LVL 40

Expert Comment

by:evilrix
ID: 21747004
This code builds fine, with the exception of (still) a missing destructor defintion
 ~QueueClass(){};


Try this...
///////////////my queuet.h

#ifndef QUEUET_H

#define QUEUET_H

 

#include <iostream>

using namespace std;

 

#define SIZE 20

 

template <typename T>

class QueueClass

{ 

 

  T queue[SIZE];

      T head, tail;

public:

 

 QueueClass(T, T);

 ~QueueClass(){};

  

 

  void qu(T num);

 

  T dequ();

  T size();

  T isEmpty();

};

 

#endif

 

////////////////////////////////my queuet.cc

 

 

template <typename T>

QueueClass<T>::QueueClass (T a, T b) { 		//expected ; befor < token

	head = a; 

	tail = b; 				

 

}

 

template <typename T> 

 

void QueueClass<T>::qu(T num) 		//init declarator before < token //expected ; befor < token

{  

	if(tail+1==head || (tail+1==SIZE && !head)) {

		cout << "Queue is full\n";

		return;

	}

	tail++;

	if(tail==SIZE) tail = 0; 

	queue[tail] = num;

}

 

template <typename T> 

 

T QueueClass<T>::dequ()		//init declarator before < token //expected ; befor < token

{

	if(head == tail) {

		cout << "Queue is empty\n";

		return 0;                   

	}

	head++;

	if(head==SIZE) head = 0;       

	return queue[head];

}

 

template <typename T> 

T QueueClass<T>::size()

{ 							//init declarator before < token //expected ; befor < token

	T j=0;

	for (; j<tail; j++){

	}

	return j;

}

 

template <typename T> 

 

T QueueClass<T>::isEmpty()

{  				//init declarator before < token //expected ; befor < token

	if(head == tail) {

		cout << "Queue is empty\n";

		return 1;

	}

	else return 0;

}

 

/////////////////////////////my main.cc

 

#include <iostream>

//#include "queuet.cc"

using namespace std ;

int main()

{

	QueueClass<int> queue1 (1,1);  ////expected ; before int //QueueClass undeclared  //expect primary expression before int

 

	cout<<"If 1, Queue is Empty, else 0 aka Queue is not empty. Result: " <<queue1.isEmpty()<<endl;

	int i;

	for(i=1; i <=10; i++) {

		queue1.qu(i);        // queue1 undecleared, first use

	}

	cout<<"If 1, Queue is Empty, else 0 aka Queue is not empty. Result: " <<queue1.isEmpty()<<endl;

	cout<< queue1.size() <<" test" <<endl;

 

	for(i=1; i <=10; i++)

		cout << "Dequeue 1: " << queue1.dequ() << endl;

 

	return 0;

}

Open in new window

0
 
LVL 40

Expert Comment

by:evilrix
ID: 21747009
^^^ Incidentally, I qualified this code using both VS2005 and gcc 4.x on Ubuntu Linux. You code builds fine, it's just failing to link because of the missing destructor... which I've now added for you.
0
 

Author Comment

by:george08
ID: 21747019
Thanks. Sleep well. but i do have to challenge the main.cc... there are still errors...
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 40

Expert Comment

by:evilrix
ID: 21747059
>> Thanks. Sleep well. but i do have to challenge the main.cc... there are still errors...
In the code I posted you? I did check it on 2 compilers :)

I've added a zip files of the 3 files I think you should have based upon how I believe your code to be structured. Take a look and see if it helps.

I really do have to go to bed now (sorry but it's 11pm in the UK and I have to be up a 6am). If you have more doubts please post them here and I'll review them when I get up... but do try and fix them yourself first or you'll learn nothing. Most of the time the compiler errors should tell you what's wrong (the compiler never lies) so you just need to read the errors carefully and read the code until you spot it.

Meanwhile, hopefully a moderator will reopen this Q so it can be closed properly.

Good luck my friend.

-Rx.
tqueue.zip
0
 

Author Comment

by:george08
ID: 21747063
This is still my problem... :-(

Hope someone could help.  I have no clue at all :-(
problem.jpg
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21747090
Have you included queuet.h in queuet.cc ??? I suspect not!
0
 
LVL 4

Expert Comment

by:anmalaver
ID: 21747095
Hi again

try to put your definition and implementation on the .h and compile only the main.cc
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21747116
>> try to put your definition and implementation on the .h and compile only the main.cc
That isn't necessary -- I suggest you take a look at how this code is structured. At this point I don't think we need to confuse the matter more by asking george08 to restructure his code... I know this build, I've tried it on 2 compilers :)
0
 

Author Comment

by:george08
ID: 21747129
@evilrix.

thanks good friend
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21747145
>> thanks good friend
No worries my friend :)

All sorted now? Builds ok?

Right, I am now off to bed (I meant it this time!)

Night all. I'll check back tomorrow in case you have any other problems.
0
 

Author Comment

by:george08
ID: 21747231
No, nothing works fine, even when i included the queuet.h ... :(

i gotta grab some sleep, cya tommorow...
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21748645
>> No, nothing works fine, even when i included the queuet.h
Ok, then can you zip up the entire project and post it here please...

http://www.ee-stuff.com/

The username and password for this siate are the same as your normal EE userename and password (this is a EE site, it's used for hosting files).

I can then look at your project as a whole and hopefully spot what I am missing. I promise you, it is going to be something very trivial... this code builds.

-Rx.
0
 

Author Comment

by:george08
ID: 21748668
0
 
LVL 40

Assisted Solution

by:evilrix
evilrix earned 400 total points
ID: 21748706
Check out the first 2 lines of your tqueue.cc

You've got the #include "tqueue.h" nested between a template construct...

template <typename T>
#include "QUEUET.H" //<-----------------------------------------------------------------------------------------This shouldn't be here., move it up 1 line!
QueueClass<T>::QueueClass (T a, T b) {             //expected ; befor < token


It should look like this...

#include "QUEUET.H" //<-----------------------------------------------------------------------------------------It should be here
template <typename T>
QueueClass<T>::QueueClass (T a, T b) {

With this one change the code builds for me

New files uploaded with the fix: https://filedb.experts-exchange.com/incoming/ee-stuff/7175-queuefifp--fixed.zip

0
 

Author Comment

by:george08
ID: 21748742
That worked. Thanks. (thumbsup)

0
 
LVL 40

Expert Comment

by:evilrix
ID: 21748771
>> That worked. Thanks. (thumbsup)
Good stuff :)
0
 

Author Comment

by:george08
ID: 21748872
One last thing to attack. Inheritance. It is not a very intelligent way of inherritance, but it is inheritance, so please do not say me that this is a silly way. ;-)

Thanks again


////////////my .h
 

#include <iostream>

using namespace std;
 

#define SIZE 20
 

class QueueElement {

public: 

 int queue[SIZE];

      int head, tail;
 

 QueueElement();

 QueueElement(int, int);

  ~QueueElement();

  
 

  void qu(int num);

  int dequ();

  int size();

  int isEmpty();

};
 

class QueueClass : public QueueElement{ // QueueClass is Subclass to QueueElement{

};
 

//// my main 
 

#include <iostream>

#include "queueBase.h"
 

QueueClass::~QueueClass () {} //error: defintion of implicitly-declared  QueueClass::~QueueClass()

QueueClass::QueueClass (int a, int b) { //error prototyp for QueueClass::QueueClass(int, int) does not match any in class QueueClass //.h line 22 Kanidates are QueueClass()

 head = a;

  tail = b;
 

}
 

void QueueClass::qu(int num) //no void QueueClass::qu member function declared in  class QueueClass

{

  if(tail+1==head || (tail+1==SIZE && !head)) {

    cout << "Queue is full\n";

    return;

  }

  tail++;

  if(tail==SIZE) tail = 0; // cycle around

  queue[tail] = num;

}
 

int QueueClass::dequ()  //no int QueueClass::dequ member function declared in  class QueueClass

{

  if(head == tail) {

    cout << "Queue is empty\n";

    return 0;                    // or some other error indicator

  }

  head++;

  if(head==SIZE) head = 0;       // cycle around

  return queue[head];

}
 

int QueueClass::size() //no int QueueClass::size member function declared in  class QueueClass

{

    int j=0;

  for (; j<tail; j++){

  }

  return j;

  }
 

 int QueueClass::isEmpty() //no int QueueClass::isEmpty member function declared in  class QueueClass

 {

    if(head == tail) {

    cout << "Queue is empty\n";

    return 1;

    }

    else return 0;

 }
 

int main()

{

  QueueClass queue1(0,0); //no matching function  for call QueueClass::QueueClass(int int)

  
 

  cout<<"If 1, Queue is Empty, else 0 aka Queue is not empty. Result: " <<queue1.isEmpty()<<endl;

  int i;

  for(i=1; i <=10; i++) {

    queue1.qu(i);

  }

  cout<<"If 1, Queue is Empty, else 0 aka Queue is not empty. Result: " <<queue1.isEmpty()<<endl;

  cout<< queue1.size() <<" test" <<endl;
 

  for(i=1; i <=10; i++)

    cout << "Dequeue 1: " << queue1.dequ() << endl;
 

  return 0;

}

Open in new window

0
 
LVL 40

Expert Comment

by:evilrix
ID: 21748934
Well, it is inheritance :) It's a little pointless since you don't do any additional implementation in the sub-class to specialize the super (base) class, but it is inheritance. Were you not meant to do this using the template though?

You need to change the implementation of your functions as they are currently trying to implement QueueClass, they now need tro implement QueueElement.

E.g.

void QueueClass::qu(int num)
{
...
}

Should be

void QueueElement::qu(int num)
{
...
}

One other thing, classes that are designed to be sub-classes should generally consider making their destructors virtual so that if the derived class is deleted in terms of a pointer to the base class the correct destructor will still be executed (ie. that of the derived class) polymorphically.

http://www.codersource.net/cpp_virtual_destructors.html
0
 

Author Comment

by:george08
ID: 21748973
thanks a lot, i'm very exhausted, so i do not care about these 'minor' details if it is silly ;-)

please help me with my last four errors

queuemain.cc line 4, queuemain.cc line 5 and queueBase.h line 22 in the code snippets i posted above.

i really appreciate....
 i never thought that i find such fine experts arround here in the internet and in the experts-exchange.com
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21749023
>> i do not care about these 'minor' details if it is silly
Which detail? Nothing I've mentioned is minor :) The destructor problem is serious, if you try and delete using a base class pointer to a derived class and the constructor isn't virtual the C++ standard states the behavior is undefined... put another way your code will crash. Did you read the link I sent you? It's important you know this, maybe not for this specific bit of code but it is an important fundamental C++ principle.

>> queuemain.cc line 4, queuemain.cc line 5 and queueBase.h line 22 in the code snippets i posted above.
You'll need to give me the errors -- I'm good but not psychic :)

>> i never thought that i find such fine experts
Thanks (thumbs up)
0
 

Author Comment

by:george08
ID: 21749043
Yes, i read your link, but - i'm too exhausted to think about it... :-(

I uploaded my file, glad that you helped me that long way last night und hope that you help me the rest of the (shorter) way

thanks

https://filedb.experts-exchange.com/incoming/ee-stuff/7176-inheritance.zip
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21749101
a) You've not change the cosntructor and destructor at the top of queuemain.cc from QueueClass to QueueElement

From this...

QueueClass::~QueueClass() {}

QueueClass::QueueClass(int a, int b) {
 head = a;
  tail = b;
}
 ...to this...

QueueElement::~QueueElement() {}

QueueElement::QueueElement(int a, int b) {
 head = a;
  tail = b;
}

But now, because you are not using default compiler synthesize constructors,  you also have to implement a new constructor for QueueQlass, which then invokes the constructor of QueueElement.

e.g.

class QueueClass : public QueueElement
{
    QueueClass(int a, int b) : QueueElement(a,b){} // Invoke base class constructor, passing parameters to it
};

0
 
LVL 40

Expert Comment

by:evilrix
ID: 21752962
Thanks VM.
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21753328
@george08, so you didn't come back to me after I clarified above about the need to write an explicit constructor for your derived class. I know you had a 24 hour window for this... did you have anymore questions or would you like any more clarification on the last point I made? Please feel free to ask if you are stuck, you can leave this Q open as long as you want as long as (a) we're still actively trying to solve your problem and (b) any additional question are directly related to the original one.

If you do want to close this Q now but you are not sure how or you are not sure which answers to select I'd be happy to make a recommendation and of course, as the other contributing expert, anmalaver's opinion should also be sought; however, being as we both have contributed to this thread it might be better if you follow Vee_Mod's advice and request help from a Zone Advisor so as to get an objective view (not that we wouldn't be objective, I'm sure). Anyway, we are all here to help so please don't be afraid to ask if you are not sure about anything.

-Rx.
0
 

Author Comment

by:george08
ID: 21753411
Thanks to you all, there might me some more questions popping up later this evening or the day after tommorow. At the moment, i'm on the road.
0
 

Author Comment

by:george08
ID: 21757728
Here's one more.

I'd like to change the inheritance to inclusion polymorphism (i hope that is the right termin)...

What i have done so far.

Change the ~ to virtual in the root class, all my methods are virtual and in my main, i created a reference object. but it does not work out, there the error i do not have a clue about. so i'm asking again for help. thank!

My Error
int main()
{
  QueueClass& queue1(0,0); //initiatilizer expression  list treated  as compond expression //invalid initialization  of non const  reference  of type Queueclass& from a tempory typ e "int"
 
0
 

Author Comment

by:george08
ID: 21757741
ahhh my browser failed... here we go again

Here's one more.

I'd like to change the inheritance to inclusion polymorphism (i hope that is the right termin)...

What i have done so far.

Change the ~ to virtual in the root class, all my methods are virtual and in my main, i created a reference object. but it does not work out, there the error i do not have a clue about. so i'm asking again for help. thank!

My Error

int main()
{
  QueueClass& queue1(0,0);

//Error
//initiatilizer expression  list treated  as compond expression //invalid initialization  of non const   reference of type Queueclass& from a //tempory typ e "int"


please see also the code snippets

 

///Queuebase.h
 

#include <iostream>

using namespace std;
 

#define SIZE 20
 

class QueueElement {

public: 

 int queue[SIZE];

      int head, tail;
 

 QueueElement();

 QueueElement(int, int);

  virtual ~QueueElement();

  
 

  virtual void qu(int num);

  virtual int dequ();

  virtual int size();

  virtual int isEmpty();

};
 

class QueueClass : public QueueElement

{

public:

    QueueClass(int a, int b) : QueueElement(a,b){} // Invoke base class constructor, passing parameters to it

};
 

///queuemain.cc
 

#include <iostream>

#include "queueBase.h"
 

QueueElement::~QueueElement() {}
 

QueueElement::QueueElement(int a, int b) {

 head = a;

  tail = b;

}
 

void QueueElement::qu(int num) 

{

  if(tail+1==head || (tail+1==SIZE && !head)) {

    cout << "Queue is full\n";

    return;

  }

  tail++;

  if(tail==SIZE) tail = 0; // cycle around

  queue[tail] = num;

}
 

int QueueElement::dequ()  

{

  if(head == tail) {

    cout << "Queue is empty\n";

    return 0;                    // or some other error indicator

  }

  head++;

  if(head==SIZE) head = 0;       // cycle around

  return queue[head];

}
 

int QueueElement::size() 

{

    int j=0;

  for (; j<tail; j++){

  }

  return j;

  }
 

 int QueueElement::isEmpty() 

 {

    if(head == tail) {

    cout << "Queue is empty\n";

    return 1;

    }

    else return 0;

 }
 

int main()

{

  QueueClass& queue1(0,0); //initiatilizer expression  list treated  as compond expression //invalid initialization  of non const  reference  of type Queueclass& from a tempory typ e "int"

  
 

  cout<<"If 1, Queue is Empty, else 0 aka Queue is not empty. Result: " <<queue1.isEmpty()<<endl;

  int i;

  for(i=1; i <=10; i++) {

    queue1.qu(i);

  }

  cout<<"If 1, Queue is Empty, else 0 aka Queue is not empty. Result: " <<queue1.isEmpty()<<endl;

  cout<< queue1.size() <<" test" <<endl;
 

  for(i=1; i <=10; i++)

    cout << "Dequeue 1: " << queue1.dequ() << endl;
 

  return 0;

}

Open in new window

0
 
LVL 40

Expert Comment

by:evilrix
ID: 21757763
In main, do either this...

QueueClass tmpqueue1(0,0); // Object
QueueClass& queue1 = tmpqueue1; // Bind reference to object

or

QueueClass const & queue1 = QueueClass (0,0); // Bind reference to temporary

Note, if you follow the second form the reference must be const because it is bound to a temporary and temporaries are considered r-values. If the reference is const you will only be able to call const qualified member functions.

http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.10
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21757823
BTW: It only makes sense to make virtual those functions those functions that you plan on being extensible in the sub-class. In some cases this wouldn't make sense and making the function virtual (a) gives it the wrong semantics and (b) is inefficient -- there is a cost to making a function virtual in both terms of performance and storage!

For example, I see little point in making IsEmpty() virtual, what possible reason could you have for wanting to specialize its behavior? It's either empty or not, surely? Functions should be made virtual with care!
0
 

Author Comment

by:george08
ID: 21767494
I made a mistake with my inheritance.

I should have converted my class Queue so that i can use inclusion polymorphism. I wanna write a abstract class queueelement which should be used as the objects i wanna put i my queue. Need help again. Please? Thanks!
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21767563
Hi george08 .

To be honest I think we are now going outside the scope of the original Q and that being the case I'd prefer if you could create a new one. One of the points of EE is to build a knowledge base of information, so each Q should only be related to one topic, any follow-up questions should be within the context of the original Q. Your original Q asked for help with templates and inheritance and it is my understanding, from your previous comments, these have now been successfully dealt with.

You'll note Vee_Mod's comment above, "As a Premium Services member, you have unlimited points. Keep your questions short, simple, and (as you have) stay active. Multiple questions in one are a real no-go". I would ask that you respect this point and log a new Q. I'd also ask that, unless there is anything specific outstanding regarding your original Q, that you consider now finalizing this Q.

If you need help with closing this Q properly please do ask. I can help you or, if you'd prefer, one of the Mods/Zone Advisors can assist (use the request for assistance link as also identified by Vee_Mod).

Many thanks george08 and I look forward to assisting you in the future.

-Rx.
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21767576
>> I think we are now going outside the scope of the original Q
Just to clarify that point, although your original Q requested help with inheritance, polymorphism is a separate subject in its own right... although it can be implemented through inheritance it isn't the only way. This being the case I think it should be handled as separate subject matter.

Thanks.
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21771011
george08,

May I ask why you've requested this Q be deleted in 7 days? Was this intentional or are you unsure how to finalize it? Would you like some assistance with this?
0
 

Author Comment

by:george08
ID: 21771074
Ah, **** i just wanted to add the point to your perfect solution... didn't wanna delete it within seven days?
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21771168
>> Ah, **** i just wanted to add the point to your perfect solution...
I'm blushing :)

Seriously though, you should go through the answers given here and select those few (keep it sensible though) that you think helped you in answering your question. You'll see a link labeled Accept Multiple Solutions (or something very similar) net to all the questions. If you select this the page will refresh and give you the opportunity to award the points to each answer you wish to select. You should look to assign more points to those answers that helped you more (think of it as though you are saying how helpful the answer was). Once you've assign the points to those few questions you can select Submit and the question will be finalized.

These links should help...

http://www.experts-exchange.com/help.jsp#hi331
http://www.experts-exchange.com/help.jsp#hi97
http://www.experts-exchange.com/help.jsp#hi100
http://www.experts-exchange.com/help.jsp#hi367

If you still need help let me know ir feel free to request assistance from a moderator.
0
 

Author Comment

by:george08
ID: 21771197
the solution i ask in my first post is solved, now i'm on my way to solve my other problem....

see here

http://www.experts-exchange.com/Programming/Languages/CPP/Q_23478995.html?cid=239#a21770945
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21771353
>> the solution i ask in my first post is solved,
Ok, so do you need any help finalizing this Q or are you now happy you know how to do it?
0
 

Author Comment

by:george08
ID: 21771578
i'm sorry if i offended someone, if i did so it was not on purpose. sorry.
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21771701
>> i'm sorry if i offended someone, if i did so it was not on purpose. sorry.
george08, no one is offended my friend :) We are only here to try and help you and I promise that is all I wish to do.

Tell you what, so as to make you life and mine easier I'll ask Vee_Mod (or another mod) to work with you to close this. Don't worry, they doesn't bite and I'm sure you'll find with there help you'll be able to finalize this question and have a very happy time on EE.

Good luck george08, see you on your other question ;)

-Rx.
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21771720
george08,

As promised, I've requested a moderator come and assist you. Whoever comes will be happy to help guide you through the process of closing a question.

Link to the request: { http:Q_23470187.html }

Many thanks.

-Rx.
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21771740
Sorry, I posted the wrong link... try again...

{ http:Q_23480376.html }
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21771903
To aid the moderator when they review this Q, my recommendation for finalization is as follows: -

PAQ: { http:#21745785 } anmalaver
PAQ: { http:#21746087 } evilrix
PAQ: { http:#21746853 } evilrix
PAQ: { http:#21746906 } evilrix
PAQ: { http:#21748706 } evilrix

I have tried to pick out the salient answers that would be useful to anyone reading the original Q.

Thanks.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now