Wrox Programmer Forums
|
C# 4.0 aka C# 2010 General Discussion Discussions about the C# 4.0, C# 4, Visual C# 2010 language and tool not related to any specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 4.0 aka C# 2010 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 7th, 2012, 09:12 AM
Authorized User
 
Join Date: Sep 2012
Posts: 29
Thanks: 14
Thanked 0 Times in 0 Posts
Default void int confusion

The following is compulsory in C#

[public] [ static ] [void/ int ] Main(){ ......} // inside the first class declaration.
In page 26 (not sure ?) it is given that the return type must be either
void of int
------ any logical reasoning for this kind of programmatic rule.
regards
amigo1
 
Old September 7th, 2012, 09:15 AM
Wrox Author
 
Join Date: Sep 2010
Posts: 175
Thanks: 3
Thanked 53 Times in 53 Posts
Default

The return type of the Main method can be void if you don't return anything. It can be int if you return a number. You can use this to start the program from a script, and check the return value from the program.
__________________
Christian
CN innovation
Visit my blog at: csharp.christiannagel.com
Follow me on twitter: @christiannagel
The Following User Says Thank You to ChristianNagel For This Useful Post:
amigo1 (September 7th, 2012)
 
Old September 7th, 2012, 09:26 AM
Authorized User
 
Join Date: Sep 2012
Posts: 29
Thanks: 14
Thanked 0 Times in 0 Posts
Default

Scripts = programs / system programs/API ???
okay
that mean they need numbers ----> I didn't know this





Similar Threads
Thread Thread Starter Forum Replies Last Post
exit from a void function Necromancer26 C# 3 October 16th, 2012 09:06 AM
error thrown by: Void AbortInternal() prv299 ASP.NET 2.0 Professional 1 June 12th, 2008 07:48 AM
Constructors return void? AndrewH Java Basics 4 February 13th, 2007 05:59 AM
Real Time Application of Void class pandian Java Basics 0 October 9th, 2006 05:36 PM
Some confusion as to which SQL to use mark.uk SQL Server 2000 6 August 12th, 2004 10:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.