Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 478763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:43:28+00:00 2026-05-13T00:43:28+00:00

I am working on a small game using C++, and I used Eclipse CDT’s

  • 0

I am working on a small game using C++, and I used Eclipse CDT’s class generator. It created a .h file with the class definitions and a .cpp file that included body-less methods for said class.

So if I followed the template, I’d have a .cpp file filled with the methods declarations, and a .cpp file with method bodies. However, I can’t include a .cpp file within another.

So what is the convention in C++ with classes and include files? What I did was fill in the method bodies right under the class declaration in the .h file, and deleted the .cpp file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T00:43:28+00:00Added an answer on May 13, 2026 at 12:43 am

    You don’t have to include the .cpp file. Including the .h file is all it takes. .h means header, ie, all it should have is function / object definitions. The actual implementations go in the .cpp file of the same name. The linker will deal with straightening it out for you.

    The header file contains declarations (also known as prototype). Inclusion of the header lets the program know “I declare something that looks like this exists”.

    The user of headers saves us the effort of declaring methods all over the place in our code files – we just do it once, then import the file.

    The .c/.cpp/.cc file includes the definition – which tells the program what the function does.

    You do not have to “include” .c files because that’s what the compiler does – it compiles all your .c files into machine code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on a small-terminal based game like the good old MUD's, written
I'm working on building a chess game in Java, and I'm currently having a
i'm having some problems with collission in a small 2D game i'm writing. I'm
I'm working on a touch based game, and I'm having issues drawing a path
I wrote a small batch file to rar all contents in all subfolders within
I'm working a small, personal Django project and I've added South (latest mercurial as
I am currently working in small chat app in iPhone. I am call to
I'm working in small app for iPhone which uses openGL. The app is supposed
We are a company, working on small and some huge project. Sometimes on one
I've been wondering if canvas has a limit boundary. I mean if I use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.