www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/12/10:30:31

From: Vic <tudor AT cam DOT org>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: A very basic question about C programming... diary of a newbie Part 1
Date: Wed, 12 Aug 1998 09:53:31 -0400
Organization: Communications Accessibles Montreal, Quebec Canada
Lines: 15
Message-ID: <35D19E5B.6246@cam.org>
References: <SS9A1.434$vq2 DOT 881313 AT newse2 DOT tampabay DOT rr DOT com>
NNTP-Posting-Host: dialup-848.hip.cam.org
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

DM wrote:
> So my question is... writing the word "void" before a function is how you
> prototype???

get a book. you need it. "void" is a type, just like int, char, float
etc. it's basically that, void, nothing. when you say void
something(void) it means the function takes no parameters and returns
nothing.
 
> Or, if you "declare" the function before the main() is that 
> prototyping?

yes. you declare the function, make a model (prorotype). you're
basically telling the compiler "this is how the function should be
called, these are the types of parameters it accepts" etc.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019