Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am reading Pro C#. It says

do be aware that the value 0 is automatically returned, even if you construct a Main() method prototyped to return void.

What does prototyped mean in this context?

The only C# related definition of a prototype I'm aware of has to do with a model or test program tossed together without the intention to go to production.

share|improve this question
    
What about javascript prototypes? Ever hear about them? –  Oded Dec 14 '11 at 15:33
    
@Oded oh yea, sure. Though, that certainly doesn't apply here. –  P.Brian.Mackey Dec 14 '11 at 15:34
    
Just making the point ;) –  Oded Dec 14 '11 at 15:34

1 Answer 1

up vote 6 down vote accepted

In this context, I believe the phrase is used a as synonym to a method signature.

You can call any method signature the prototype of the actual call.

A bit of a throwback to c and header files.

See wikipedia - Function prototype:

A function prototype in C, Perl or C++ is a declaration of a function that omits the function body but does specify the function's return type, name, arity and argument types. While a function definition specifies what a function does, a function prototype can be thought of as specifying its interface.

share|improve this answer
    
+1 Thanks Oded. As usual, genius insight. –  P.Brian.Mackey Dec 14 '11 at 15:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.