I thought that I defined it here. If I untemplate the class it works.
using namespace std;
template<class T>
class Test // <<-- I thoght that I declared the class "TEST" here
{ private:...
Type: Posts; User: Mr_roboto
I thought that I defined it here. If I untemplate the class it works.
using namespace std;
template<class T>
class Test // <<-- I thoght that I declared the class "TEST" here
{ private:...
I can not seem to get my try/catch block to work.
I am trying to use it in a templated class and I keep getting parse errors.
Is my syntax correct?
I have also tried
template<class T>
First off. Thank your for your help and patience.
I have updated my off lined functions with the syntax.
void BankAccount<T>::Function()
{~~Foo~~; }
I am lost when it comes to scope.
I concede that templating the class is over kill, and a bit pointless, but I am trying to learn. Baby steps and all.
I tried telmplating the functions as suggested, but still got errors. Here...
Hello,
I am trying to convert a regular class to a templated one.
I thought this would be simple enough, but now I my functions do not compile.
Where have I cone wrong?
I think I finally see the light.
So if I understand this
Account<int> my_dollar_account;
'int' is giving a type to the generic T that is being used in the functions.
OK. I think I understand.
Is this a better use of a template class. This way the user can enter an integer, float, double...
template <class T>
class Account
{ public:
void...
In this case it looks like I am declaring a template class Foo and then trying to create an array of type Foo to hold names and ages.
template<class T>
class Foo
{ public:
void...
Hello,
I am trying to wrap my head around class templates.
I have an array but do not know how to implement with a template class.
Before Template:
class Foo
Syneris,
Thank you for your help.
Your note about the console project reminded me that I was actually in a windows application project. Once I copied everything over to a console project...
Ok I think I understand what is going on but I still get
" gcc: Compilation of header file requested
gcc: file path prefix `C:\DEV-C_~1\Bin\' never used "
errors when I try to compile.
...
I am trying to use .h and .cpp file in a program that I working on. I can not seem to get it to work.
Is this the correct format?
This is my .h file
//big.h
Thank you everyone.
I appreciate the help.
~Rich
It is my understanding that 'strlen()' is recursive and is not the most efficient way to derive the length of a string. Would it be better to just use the maximum size of the string instead? Is...
Awsome tips guys.
Thank you.
I have a function that will only work with integers. Is there a library function that will check user input to make sure that the data entered is integers.
[EDIT]
Currently I am using a bool...
I got it working :D
Thank you all especially David and Tonto.
~Rich
Sometimes learning is an up hill battle ;)
I realize that I am trying to use the '==' operator in an uncommon way. I would like to over load the '==' operator so that I can use it in a search...
There is not that much to it. I am trying to learn things on a small scale first.
I think that I implemented the the example in the fallowing code. Seeing how it will not compile I sure...
Hello,
I am new to C++ and am trying to learn about operator overloading. I can not seem to wrap my mind around how it works. Could someone please point me in the right direction.
...