You obviously have no idea what you're doing, so let me help you clarify your definition of '.cpp file':
Back in the day when we did not have IDe (integrated development environments, which is most likely what you're useing), you would have to put everything into 1 file.
The advantages of an IDE are that you can create projects. Using this, you can create different .cpp and .h files. you emplement functions in .cpp files, and write their definition (like a forward declaration) in the header files (which includes declaring default arguments). Using the preprocessor directive #include , you can add these .cpp files to any other .cpp files as though you are adding those 'forward declarations'. You CAN NOT CALL .CPP FILES. You can only call the ufunctions within those .cpp files, if they are declared in the header files. It is good practice to include the header file in the .cpp file it is related to.
for example, if i have common.cpp, and i have common.h, i would include common.h in common.cpp so that if i dont want to have some functions in common.h that use other functions in common.cpp, their default arguments are defined.
So, if you really wanted to generalize it, it would be more like adding functions to other .cpp files more conveniently. I like to use header/.cpp files as a way to create functions that i can use in multiple programs simply by adding their .cpp/header into the project, and including them in the files i need to use their functions in.
ok i understand you can't call a .cpp file from another .cpp so i changed some things:
first.cpp is the main, second.cpp contains the code for all the functions
second.cpp now has a header file where all the functions are defined
i am trying to call this function from second.cpp and run it in first.cpp
void example(string, int);
In .cpp file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
void Class_name::example(string s = "", int x = 0)
cout<< "Set up whatever you want..."<< endl;
all these files have to be part of the same project.