Bug 1572

Summary: Omitted main () in tutorial code sample
Product: ns-3 Reporter: aram <arsadogi>
Component: documentationAssignee: Tom Henderson <tomh>
Status: RESOLVED WONTFIX    
Severity: trivial CC: ns-bugs
Priority: P5    
Version: pre-release   
Hardware: All   
OS: All   

Description aram 2013-01-24 12:54:22 UTC
At the tutorial found here 
http://www.nsnam.org/docs/tutorial/html/building-topologies.html

The code 

int
main (int argc, char *argv[])
{

is omitted from the following code sample presented in the tutorial.

bool verbose = true;
uint32_t nCsma = 3;

CommandLine cmd;
cmd.AddValue ("nCsma", "Number of \"extra\" CSMA nodes/devices", nCsma);
cmd.AddValue ("verbose", "Tell echo applications to log if true", verbose);

cmd.Parse (argc, argv);

if (verbose)
  {
    LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO);
    LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO);
  }

nCsma = nCsma == 0 ? 1 : nCsma;
Comment 1 Tom Henderson 2013-01-25 14:57:17 UTC
I don't think that this needs to be addressed; the omission of main() was intentional since it is common to every C++ program.
Comment 2 aram 2013-01-26 13:20:20 UTC
Because the code sample was closing with

  return 0;
}

I thought it would be a good idea to begin with the main, in case someone
wants to only copy paste the code and test it.

In any case it is a trivial thing.
I apologize for the noise.