-3

Scheduler::Scheduler() : clock_(SCHED_START), halted_(0){ }

How the above is valid in c++, which was available in scheduler.cc of NS2 So any one kindly explain about the above code. Thanks in advance

Dyrandz Famador
  • 4,499
  • 5
  • 25
  • 40
  • 1
    This basic stuff is covered in all C++ text books.- why not read one – Ed Heal Feb 07 '15 at 08:24
  • possible duplicate of [What is this weird colon-member (" : ") syntax in the constructor?](http://stackoverflow.com/questions/1711990/what-is-this-weird-colon-member-syntax-in-the-constructor) – T.C. Feb 07 '15 at 09:08

1 Answers1

1

as @EdHeal said, check a C++ book

That's how you initialize members of a class while constructing an Object in C++. It can be used also for RAII technique.

When Scheduler is constructed, clock member is set to assume the value of SCHED_START and halted is set to assume value 0.

madduci
  • 2,635
  • 1
  • 32
  • 51