r/cpp•
VertexGG

Compile every C++ file or use Headers

Hello, I'm pretty new to C++ so i might be asking a very stupid question. But the tutorial I was following showed me that i could compile every C++ file i have by adding this in tasks.json args:

"${fileDirname}\\**.cpp"

anyway this allowed me to use functions from other cpp files in my main cpp file but after i learned about headers and I'm not sure what's better using headers or whatever this method was.

i tried doing some research but I'm not sure everyone had different opinions.

Posted Apr 9, 2025, 8:19 PM UTC

16
Loading comments…