I got this error ,,"vector" was not declared in this scope'' for the following code when I separate in *h and *cpp a file This is the main.cpp:
#include <iostream>
#include <math.h>
#include <vector>
#include "functia.h"
using namespace std;
int main()
{
vector<double> s(3);
double b= 4;
fun(s, b);
cout<<s[0]<<endl;
double c= 9;
fun(s, c);
cout<<s[0];
}
functia.h:
void fun(vector<double> & rS, double a)
{
rS[0] = a + 3;
rS[1] = 4;
rS[2] = 5;
}
functia.cpp:
#include <iostream>
#include <math.h>
#include<vector>
using namespace std;
void fun(vector<double> &, double );
fun(...)
? Something seems odd there. – Imitative