Sorry for asking such a beginner question, but I'm stuck writing header files. For information, there aren't StackOverflow articles relating to the problem I have -- it seems like I've got a very simple setting wrong but couldn't find it on the internet.
Error message:
insertion/insertion.h:16:24: error: expected unqualified-id before ')' token
16 | void insertion();
insertion.cpp:
#include <insertion.h>
// more imports
void insertion() {
// implementation not shown
}
int main() {
insertion();
return 0;
}
insertion.h:
#include <iostream>
// exactly the same imports as the file above but didn't import itself
#ifndef insertion
#define insertion
class Insertion {
public:
void insertion();
};
#endif
execute.cpp:
#include "insertion/insertion.h"
using namespace std;
int main() {
// still writing
}
The file structure looks like this:
|- execute.cpp
|- insertion\
|---- insertion.cpp
|---- insertion.h
Any help is greatly appreciated.