Chcę by ciało mojej funkcji znajdywało się nie w pliku main, a w osobnym pliku. Zrobiłem 3 pliki, wyskakuje komunikat, "funkcja was not declared in this scope".Funkcja ma przykladowo wypisywac X na ekranie.
main.cpp
#include <iostream>
#include "hpp.hpp"
using namespace std;
int main()
{
funkcja();
return 0;
}
hpp.hpp
#ifndef HPP_HPP_INCLUDED
#define HPP_HPP_INCLUDED
void funkcja();
#endif // HPP_HPP_INCLUDED
cpp.cpp
#include <iostream>
#include "hpp.hpp"
using namespace std;
void funkcja()
{
cout<<"X";
}