Die Suchfunktion habe ich bereits verwendet da mir nichts weitergeholfen hat, poste ich einmal hier meine Frage.
Ich bin neu in diesem Forum (erser Post
![:D](wcf/images/smilies/biggrin.png.pagespeed.ce.UPFXer8Yu2.png)
) und falls es das falsche Unterforum ist tut es mir leid, ich bin noch nicht mit der Struktur der Seite vertraut.
Mein eigentliches Problem steht ja schon in der Überschrift, hier die genaue Frage mit Code:
Calculator.hpp
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#pragma once
template <class T>
class CCalculator
{
private:
T m_Digit01; // first digit to calculate
public:
CCalculator(); // Constructor
~CCalculator(); // Destructor
// Getter- and Setter-Methods
T getDigit01(); // m_Digit01
setDigit01(T);
};
|
Calculator.cpp
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#include "Calculator.hpp"
#include <iostream>
using namespace std;
// Constructor & Destructor
//
template <class T>
CCalculator<T>::CCalculator(void)
{
cout << "Calculator Destruktor!" << endl;
}
template <class T>
CCalculator<T>::~CCalculator(void)
{
}
//
// Eof: Constructor & Destructor
// Getter- Setter- not implemented
|
main.cpp
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
|
#include <iostream>
#include "Calculator.hpp"
using namespace std;
int main()
{
CCalculator<int> iCalc1;
}
|
Ich bekomme diesen Fehler:
error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
in calculator.hpp Zeile 15 Spalte 1: "setDigit01(T);"
Bitte um Hilfe.