Ask Question
14 January, 21:53

In c + + when you create a class and you don't want to put the class and the main program in one source file and let's say you create two separate source files one for the class and one for the program how do you make use of the class in the source file for the main program

+1
Answers (1)
  1. 15 January, 00:58
    0
    Usually, you make a header file of the class with it's prototype and include it in your main program using double quotes instead of. This is how it's done with libraries that are compiled. In your case, this leaves the Class. cpp file unlinked. You could put an include at the end of the header file, or in this case I believe that you can just include the Class. cpp in your main source:

    #include "Class. cpp"
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “In c + + when you create a class and you don't want to put the class and the main program in one source file and let's say you create two ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers