Home > Archive > C > February 2006 > Re: need to compile this ( trying to find roots of a bisection)
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: need to compile this ( trying to find roots of a bisection)
|
|
| Keith Thompson 2006-02-26, 3:55 am |
| CBFalconer <cbfalconer@yahoo.com> writes:
> anand wrote:
[...]
>
> It won't compile. There is no such header file as conio.h. There
> is no such routine as clrscr(). main returns an int, not void. I
> did not look further.
>
> At least in C. If you are using some other language with vague
> similarities to C you need to use a newsgroup that deals with that
> language. This is not it.
As I'm sure you know, there is a header file called conio.h and a
function called clrscr() *on some systems*. (Of course, there's no
reason to use either in a program that just performs some mathematical
operations.)
Declaring "void main()" makes it incorrect C, not non-C.
The use of system-specific headers and functions makes the program
non-portable (and off-topic here); it doesn't make it non-C. One of
C's greatest assets is its ability to support system-specific
extensions.
What makes the program non-C is its use of "Else" and "If" rather than
"else" and "if".
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
| |
| Micah Cowan 2006-02-27, 6:57 pm |
| Keith Thompson <kst-u@mib.org> writes:
> CBFalconer <cbfalconer@yahoo.com> writes:
> Declaring "void main()" makes it incorrect C, not non-C.
Well, nowadays, it makes it non-portable C, not incorrect C. :-)
'course, depending on your definition for "incorrect C", the two may
overlap... :-)
> What makes the program non-C is its use of "Else" and "If" rather than
> "else" and "if".
I suspect the OP was used to MS Visual Basic or somesuch.
| |
| Richard G. Riley 2006-02-27, 6:57 pm |
| On 2006-02-27, Micah Cowan <micah@cowan.name> wrote:
> Keith Thompson <kst-u@mib.org> writes:
>
>
>
> Well, nowadays, it makes it non-portable C, not incorrect C. :-)
>
> 'course, depending on your definition for "incorrect C", the two may
> overlap... :-)
>
>
> I suspect the OP was used to MS Visual Basic or somesuch.
It makes it non "standard" : and CBF was, as is his wont, pointing
that out.
The ANSI ISO 9899 standard says that main must be defined to return
type of int.
--
Remove evomer to reply
|
|
|
|
|