I want to clear cache during an ongoing script before I benchmark some results, and I use the answer mentioned in this question for that.
The answer basically is:
sync();
std::ofstream ofs("/proc/sys/vm/drop_caches");
ofs << "3" << std::endl;
But when I do that, I get:
rTree.cpp:157:4: error: ‘sync’ was not declared in this scope
157 | sync();
| ^~~~
I tried to google, but almost every link is related to variables/methods not being declared in the scope (I can see why, but that doesn't really solve my problem). Any would be great, thanks...