+ 3
(C++) extern class?
lets say i have 3 files. file1.cpp file2.cpp file3.h file1.cpp is contain main function and a class named "game". and "game" class need "player" class. so i wrote "player" class in file2.cpp. file3.h is containing some useful functions (like index, convert data types). so how to share "player" class into file1.cpp? i know it can be done easily with putting "player" class in file3.h or put #include "file2.cpp" in file1.cpp, but i wont. i just want to know. (just like extern class)
10 Antworten
+ 1
now im using c++ complier. im not sure but in terminal i can type c++ file1 file2 -o file_output
+ 1
@jamie
we dont need to include file2.h in file2.cpp?
+ 1
basically that puts player class in header file. but i think that is the only way...thanks
0
https://www.programiz.com/cpp-programming/library-function/cstdio/fscanf
i read that. im not sure
i think fscanf is only sharing variable