In 10 carts

Price: ₹ 131.000

Original Price: ₹ 414.000

50% off
New markdown! Biggest sale in 60+ days

Main ttm: What is the correct (most efficient) way

You can only make an offer when buying a single item

Add to cart

What is the correct (most efficient) way to define the main () function in C and C++ — int main () or void main () — and why? And how about the arguments? If int main () then return 1 or return 0? The Python approach to " main " is almost unique to the language ("). The semantics are a bit subtle. The __name__ identifier is bound to the name of any module as it's being imported. However, when a file is being executed then __name__ is set to "__main__" (the literal string: __main__). This is almost always used to separate the portion of code which should be executed from the portions of code which define functionality. So Python code often contains a line like: #!/usr/bin/env python from ... If you want examples of main () calling main (), here are plenty: ioccc.org It's the website of the International Obfuscated C Code Contest, and folding everything into a single function called main is an effective obfuscation technique. The interesting part is "with no parameters". int main () and int main (void) are currently equivalent, since they are both function declarators and have no parameters. The following applies (6.7.6.3 ): 10 The special case of an unnamed parameter of type void as the only item in the list specifies that the function has no parameters. /--/

4.9 out of 5

(14020 reviews)

5/5 Item quality
4/5 Shipping
4/5 Customer service
Loading