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 6029679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:55:20+00:00 2026-05-23T04:55:20+00:00

I am a newbie of using c++. I am following a tutorial to get

  • 0

I am a newbie of using c++. I am following a tutorial to get some idea of basic structure of C++ and I see function calls in the header files.

I have something like this

class cuserlist : public cmutex
{
private:
  list < cuser* >_clientlist;


  bool init ();
  bool destroy ();
public:
    cuserlist ()
  {
    init ();
  }
   ~cuserlist ()
  {
    destroy ();
  }


  bool add(int cfd);
  bool remove(int cfd);
  cuser* find(int cfd);
  list < cuser* > * getclientlistptr() {
    return &_clientlist;
  }

};

In this header file it calls init() function in the constructor declaration. I can assume that it will call the function whenever user create cuserlist class but don’t see the exact moment when it is going to be called and how it works.

Thanks in advance.

  • 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-23T04:55:21+00:00Added an answer on May 23, 2026 at 4:55 am

    Yes, You can call functions even in header files. Doing so will call the appropriate functions. When you include header files using #include the compile replaces the statement with the entire contents of the header file, just like a simple copy paste.

    In your code cuserlist() is an Inline function, Incidentally, cuserlist() happens to be the class constructor in this case. So it is a constructor function which is inline. Constructors are called whenever a object gets created. For example:

    cuserlist obj;
    cuserlist *ptr = new cuserlist();
    

    Both statements will call cuserlist() which in turn then calls init().

    In case of Inline Functons the definition of the function is at the same time when it is declared.

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

Sidebar

Related Questions

I'm a complete jquery newbie, but I'm following this tutorial here to get me
I am an iOS newbie. I am using the following function to insert new
I am newbie in Ruby. I installed by following this tutorial: http://udooz.net/blog/2011/02/facebook-app-using-rails-koala/ Now, when
I am a newbie when it comes to using WinAPI. I am following a
I am (newbie) using Kohana V 3.0.3 and my directory structure is: pojectsys (kohana's
I was newbie in using sqlite database android. and now I have a problem
hey, I am a newbie in symfony. I am following this joobet tutorial on
Newbie here programming my first app (having made several tutorial apps). I am using
.NET newbie alert Using Visual C# 2008 Express Edition I have accidentally created a
I'm a Spring newbie, I'm following some examples from books and tutorials in the

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.