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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:09:02+00:00 2026-05-14T07:09:02+00:00

Well, I’m gonna be pretty straightforward here, I just have a piece of code

  • 0

Well, I’m gonna be pretty straightforward here, I just have a piece of code in c++ which I’m not sure I really understand and need some help with.

Ok, to simplify lets just say I have a class that is defined like this: (the real class is a little bit more complicated, but this is what matters)

class myClass : public Runnable {
    Semaphore *m_pMySemaphore;
    __Queue<Requests> *m_pQueue;
    Request m_Request;
    VetorSlotBuffer *m_vetorSlotBuffer;
}

Up to here nothing is wrong, myClass is just a regular class which has 3 members that actually are pointers to other classes and an object of the class Request, the implementation of those classes not being important for my point here.

Then when this person implemented the constructor for myClass he or she did this:

myClass::myClass() : m_pMySemaphore(0), m_pQueue(0), m_vetorSlotBuffer(0) {
}

It’s pretty evident that those three variables are treated like that by the constructor because they are pointers, am I right? but what kind of syntax is that? am I setting the pointers to null by doing that? I’ve seen a little bit of c++ already but never found something like that.

And secondly, what’s the deal with the “:” after the constructor declaration? that I’ve seen but never took the time to investigate. Is this like an inner class or something?

Thank you very much in advance.
Nelson R. Perez

  • 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-14T07:09:02+00:00Added an answer on May 14, 2026 at 7:09 am

    This is an initialization list

    And it’s the recommended way to initialize your members

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

Sidebar

Related Questions

Well, my website can not redirect to https://www.facebook.com/QuaFootSpa from http://quafootspa.com/ I have tried redirection
Well, I have a application which somehow requires some system resources, but how do
Well i have a long string in double quotes var Variable = Really Long
Well, not sure I am going to be able to write this out to
Well here is my problem: I have a table with an iframe in the
well my problem is that, i have a form, which i want to validate
Well, i have such-like code that prevent select all action from keyboard: $(document).keydown(function(e){ //
Well friends, I have got this query which works but is very long for
well i have a configuration like this in the components part of my config
Well, the title pretty much states it. I want to be able to draw

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.