Bugzilla – Bug 1572
Omitted main () in tutorial code sample
Last modified: 2013-01-26 13:20:20 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;
I don't think that this needs to be addressed; the omission of main() was intentional since it is common to every C++ program.
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.