EL> I just compiled it and works for me...
CF>> void main()
EL> I would do
EL> void main(void)
EL> but then, that's just me... :) if your compiler doesn't complain it
EL> shouldn't be reason enought for the program to stop execution.
the correct and idiomatic way of writing a main when you don't use any
parameters is:
/* K&R C */
main () {
/* ANSI C */
int main (void) {
// C++
int main () {
when you do use parameters, it's:
/* K&R C */
main (argc,argv)
char *argv[];
{
/* ANSI C, all C++ */
int main (int argc, char *argv[]) {
though **argv is considered correct.
return type is always int. you return 0 if the program is correct.
assign a non-zero value to each error situation your batchfiles should
know about. Most programs giving a visual result should always return 0
since almost never will their values be useful to batchfiles, but i say
*most*.
incidentally, in Java, though not a direct evolution of C/C++, uses the
following syntax:
public static void main (String[] args) {
which means that someone at Sun Microsystems hates batchfiles.
matju
--- Terminate 4.00/Pro
---------------
* Origin: The Lost Remains Of SatelliteSoft BBS (1:163/215.42)
|