Home > Back-end >  The use of visual studio 2015
The use of visual studio 2015

Time:09-25

Visual studio 2015 to build a c + + program, there are two CPP files, one of the main function, the other has a general function, why is the main function calls another function error
Test. The CPP
#include
using namespace std;
Int main () {
The test ();
return 0;
}
Test1. CPP
#include
using namespace std;
Void test () {
Cout<" Aaaaaaaaa "& lt; }
Run time said there will be a test: can't find the identifier

CodePudding user response:

Test. The CPP
#include
using namespace std;
extern void test ();//try to join the
Int main () {
The test ();
return 0;
}

CodePudding user response:

You can run, thank you

CodePudding user response:

If I wrote a test1. H header file, in the test. The CPP contained in the header file also want to add this sentence?

CodePudding user response:

# include a header file, you need to understand is opened is directly head file content written in that position,
  • Related