I am very new to coding, so forgive me if my question is too stupid.
I just started learning how to code in C++ and now I am trying to learn how to create projects with multiple files but there's a problem. When I create a new file, I can't add more files to that project in the left panel in CodeBlocks.
Also when creating the file, CodeBlocks doesn't let me tick the option "Add file to active procejts In build target(s):". I am thinking maybe this causes the problem?
#include <iostream>
int add(int x, int y);
int main()
{
std::cout << "The sum of 3 and 4 is: " << add(3, 4) << '\n';
return 0;
}
Above is my main file, I want this code to call the below function which should be in the separate file, but it doesn't work.
int add(int x, int y)
{
return x + y;
}
Thanks very much in advance for all the help!