i have this error in the title: here class declaration of variables and prototypes of function
#ifndef ROZKLADLICZBY_H
#define ROZKLADLICZBY_H
class RozkladLiczby{
public:
RozkladLiczby(int); //konstruktor
vector<int> CzynnikiPierwsze(int); //metoda
~RozkladLiczby();
};
#endif
And class body:
#include "RozkladLiczby.h"
using namespace std;
#include <iostream>
#include <vector>
RozkladLiczby::~RozkladLiczby() //destruktor
{}
RozkladLiczby::RozkladLiczby(int n){
int* tab = new int[n+1];
int i,j;
for( i=0;i<=n;i++)
tab[i]=0; //zerujemy tablice
for( i=2;i<=n;i+=2)
tab[i]=2; //zajmujemy sie liczbami parzystymi
for(i=3; i<=n;i+=2)
for(j=i;j<=n;j+=i) //sito erastotesa
if(tab[j]==0)
tab[j]=i;
}
vector<int> RozkladLiczby::CzynnikiPierwsze(int m){
vector<int> tablica;
while(m!=1){
tablica.push_back(tab[m]);
m=m/tab[m];
}
return tablica;
}
Whats wrong with the prototype of function in first block? Why vector is told to be not a type? I would be grateful if u could help me to find out this.