Some Questions.

Discussion in 'C Programming' started by GeorgeRXZ, Oct 11, 2007.

  1. GeorgeRXZ

    GeorgeRXZ Guest

    Hi Friends,

    I have some questions related to C Language.

    1> What is the difference between the standard C language and Non
    standard C language ?

    2> which is better C Lanugage, C under Linux/ Unix or C under
    windows/ DOS ?

    3> Under Linux Platform why Conio.h and and many other header files
    are not available in C Language Compiler ?

    4> Which is latest version of C ? and who makes changes to the
    language Syntax and Add new features or upgrade the language ?



    I have written some programs in C language and have uploaded the
    source codes to my website.

    http://zsoftwares.googlepages.com/CPrograms.html
    http://zsoftwares.googlepages.com/DSFPrograms.htm

    I have used Turboc compiler (borland International) for writing and
    executing all source programs in C on above website. All source code
    run properly and gives output under Windows / DOS platform.( Turboc
    Compiler). But these programs don't run on compiler of linux os why
    this happens ?

    [I am student of Computer Engg.]
    you can mail me at

    GEOrgE
     
    GeorgeRXZ, Oct 11, 2007
    #1
    1. Advertising

  2. GeorgeRXZ said:

    > Hi Friends,
    >
    > I have some questions related to C Language.
    >
    > 1> What is the difference between the standard C language and Non
    > standard C language ?


    Standard C is C. "Non-standard C" is something that isn't C.

    > 2> which is better C Lanugage, C under Linux/ Unix or C under
    > windows/ DOS ?


    The C language doesn't care which platform you use.

    > 3> Under Linux Platform why Conio.h and and many other header files
    > are not available in C Language Compiler ?


    C doesn't define Conio.h. If you want one, write your own.

    > 4> Which is latest version of C ?


    The barely-implemented ISO/IEC 9899:1999.

    > and who makes changes to the
    > language Syntax and Add new features or upgrade the language ?


    ISO.

    > I have written some programs in C language and have uploaded the
    > source codes to my website.
    >
    > http://zsoftwares.googlepages.com/CPrograms.html
    > http://zsoftwares.googlepages.com/DSFPrograms.htm
    >
    > I have used Turboc compiler (borland International) for writing and
    > executing all source programs in C on above website. All source code
    > run properly and gives output under Windows / DOS platform.( Turboc
    > Compiler). But these programs don't run on compiler of linux os why
    > this happens ?


    I looked at the list of problems you claim to have solved, and there's no
    reason why any of them can't be solved in a way that works on both Windows
    and Linux, using the C language.

    Then I looked at your code. As well as being poor C, it unnecessarily uses
    non-standard language and library extensions. Remove these and tidy up the
    C itself, and you will find that you are able to port the code to Linux
    effortlessly.

    --
    Richard Heathfield <http://www.cpax.org.uk>
    Email: -http://www. +rjh@
    Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
    "Usenet is a strange place" - dmr 29 July 1999
     
    Richard Heathfield, Oct 11, 2007
    #2
    1. Advertising

  3. GeorgeRXZ

    GeorgeRXZ Guest

    On Oct 11, 2:47 am, Richard Heathfield <> wrote:
    > GeorgeRXZ said:
    >
    > > Hi Friends,

    >
    > > I have some questions related to C Language.

    >
    > > 1> What is the difference between the standard C language and Non
    > > standard C language ?

    >
    > Standard C is C. "Non-standard C" is something that isn't C.
    >
    > > 2> which is better C Lanugage, C under Linux/ Unix or C under
    > > windows/ DOS ?

    >
    > The C language doesn't care which platform you use.
    >
    > > 3> Under Linux Platform why Conio.h and and many other header files
    > > are not available in C Language Compiler ?

    >
    > C doesn't define Conio.h. If you want one, write your own.
    >
    > > 4> Which is latest version of C ?

    >
    > The barely-implemented ISO/IEC 9899:1999.
    >
    > > and who makes changes to the
    > > language Syntax and Add new features or upgrade the language ?

    >
    > ISO.
    >
    > > I have written some programs in C language and have uploaded the
    > > source codes to my website.

    >
    > >http://zsoftwares.googlepages.com/CPrograms.html
    > >http://zsoftwares.googlepages.com/DSFPrograms.htm

    >
    > > I have used Turboc compiler (borland International) for writing and
    > > executing all source programs in C on above website. All source code
    > > run properly and gives output under Windows / DOS platform.( Turboc
    > > Compiler). But these programs don't run on compiler of linux os why
    > > this happens ?

    >
    > I looked at the list of problems you claim to have solved, and there's no
    > reason why any of them can't be solved in a way that works on both Windows
    > and Linux, using the C language.
    >
    > Then I looked at your code. As well as being poor C, it unnecessarily uses
    > non-standard language and library extensions. Remove these and tidy up the
    > C itself, and you will find that you are able to port the code to Linux
    > effortlessly.
    >
    > --
    > Richard Heathfield <http://www.cpax.org.uk>
    > Email: -http://www. +rjh@
    > Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
    > "Usenet is a strange place" - dmr 29 July 1999


    Mr. Richard Heathfield. thanks for your feedback. But My questions
    remained unanswered I don't need remark on my source codes (good or
    bad).

    I expect you to give answers of my four Questions.

    1> What is the difference between the standard C language and Non
    standard C language ?


    2> which is better C Lanugage, C under Linux/ Unix or C under
    windows/ DOS ?


    3> Under Linux Platform why Conio.h and and many other header files
    are not available in C Language Compiler ?


    4> Which is latest version of C ? and who makes changes to the
    language Syntax and Add new features or upgrade the language ?

    GEOrgE
     
    GeorgeRXZ, Oct 11, 2007
    #3
  4. GeorgeRXZ

    jacob navia Guest

    GeorgeRXZ wrote:
    > 1> What is the difference between the standard C language and Non
    > standard C language ?
    >


    A fully compliant program will not use any compiler extensions.
    Standard extensions are common, and most programs use them.

    A fully compliant program will only use the features included in the C
    standard. This standard was published in 1999 and it is called C99.

    You can buy the standard document from ANSI/ISO.

    >
    > 2> which is better C Lanugage, C under Linux/ Unix or C under
    > windows/ DOS ?
    >


    C is not dependent from a single operating system, so you will
    be able to use C code as well as in windows as in linux.
    Linux C is well supported. Windows C is well supported too.

    You should define what is "better" before asking here what is "better".

    Better for what?

    >
    > 3> Under Linux Platform why Conio.h and and many other header files
    > are not available in C Language Compiler ?
    >


    Yes, but there are compilers that provide a compatibility layer for
    conio.h. The lcc-win32 compiler provides an emulation of the
    Borland interface under windows. You can download that compiler
    at no cost from http://www.cs.virginia.edu/~lcc-win32.
    Note that there is no conio.h in the linux version of the same
    compiler. You should use the ncurses library to have an equivalent
    functionality.

    >
    > 4> Which is latest version of C ?


    The standard of 1999, published by ISO/ANSI.


    > and who makes changes to the
    > language Syntax and Add new features or upgrade the language ?
    >


    There is a committee that decides the standardization of features,
    publishes the standard, and in general takes care of those
    aspects of C. This is the standards committee.

    Normally, before a feature is standarddized, it is (by definition)
    non-standard, and doesn't belong to the official language yet.

    For instance, the standard of C99 defined variable length arrays after
    one popular compiler had introduced that feature as an extension.
    This brings us back to your first question. Most compilers propose
    extensions, that are not part of the official language but are
    part of C as it is used outside the official definition.

    --
    jacob navia
    jacob at jacob point remcomp point fr
    logiciels/informatique
    http://www.cs.virginia.edu/~lcc-win32
     
    jacob navia, Oct 11, 2007
    #4
  5. GeorgeRXZ

    Mark Bluemel Guest

    GeorgeRXZ wrote:
    > On Oct 11, 2:47 am, Richard Heathfield <> wrote:

    ....
    >
    > Mr. Richard Heathfield. thanks for your feedback. But My questions
    > remained unanswered I don't need remark on my source codes (good or
    > bad).


    He did answer your questions, interleaving his responses with your
    questions in his posting.

    If you didn't understand his answers you should have asked for
    clarification.

    As for not needing remark on your source code, you asked why you
    couldn't port it to Linux, so you must have expected people to examine it...
     
    Mark Bluemel, Oct 11, 2007
    #5
  6. GeorgeRXZ <> writes:
    > On Oct 11, 2:47 am, Richard Heathfield <> wrote:

    [...]
    >> I looked at the list of problems you claim to have solved, and there's no
    >> reason why any of them can't be solved in a way that works on both Windows
    >> and Linux, using the C language.
    >>
    >> Then I looked at your code. As well as being poor C, it unnecessarily uses
    >> non-standard language and library extensions. Remove these and tidy up the
    >> C itself, and you will find that you are able to port the code to Linux
    >> effortlessly.


    When you post a followup, it's rarely necessary to quote the entire
    previous article. Delete anything that's not relevant to your
    followup. In particular, don't quote the signature (the stuff
    following the "-- " line) unless you're actually commenting on it.

    > Mr. Richard Heathfield. thanks for your feedback. But My questions
    > remained unanswered I don't need remark on my source codes (good or
    > bad).


    The only way to avoid comments on your source code is to hide it.
    Richard gave you some good advice. (Disclaimer: I haven't looked at
    your source code myself, but I'm certain that his advice was good.)

    > I expect you to give answers of my four Questions.


    The way you phrased that makes it sound like you're giving orders.
    I hope that wasn't the way you meant it. Nobody here is obligated to
    help you.

    > 1> What is the difference between the standard C language and Non
    > standard C language ?


    He already answered that. The C language is defined by the ISO
    standard(s). There are a number of non-standard dialects that are
    similar to C; each one differs from C in its own ways.

    > 2> which is better C Lanugage, C under Linux/ Unix or C under
    > windows/ DOS ?


    The actual language is the same. Various implementations may provide
    different extensions; neither is "better". If you want more
    information about Linux or Unix, ask in comp.unix.programmer; for
    Windows or DOS, try a newsgroup that deals with those systems.

    > 3> Under Linux Platform why Conio.h and and many other header files
    > are not available in C Language Compiler ?


    Because <conio.h> is specific to DOS or Windows.

    > 4> Which is latest version of C ? and who makes changes to the
    > language Syntax and Add new features or upgrade the language ?


    Richard already answered that: ISO. (ISO is the International
    Organization for Standardization <http://www.iso.org/>.)

    --
    Keith Thompson (The_Other_Keith) <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."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Oct 11, 2007
    #6
  7. On Oct 11, 11:54 am, GeorgeRXZ <> wrote:
    <snip>
    >
    > Mr. Richard Heathfield. thanks for your feedback. But My questions
    > remained unanswered I don't need remark on my source codes (good or
    > bad).
    >


    Well, if you cannot accept criticism, please do not post your code for
    analysis. It takes a long time to learn how to write portable and
    efficient code and people here at clc (like Richard) are the experts
    at it and willing to help for free. Accept their comments graciously.
    Just a friendly advice.

    > I expect you to give answers of my four Questions.
    >
    > 1> What is the difference between the standard C language and Non
    > standard C language ?


    Standard C is the language that complies to the ISO standards. I have
    never heard of anything called Non-standard C. May be any platform
    specific code written in C can be called Non Standard C
    >
    > 2> which is better C Lanugage, C under Linux/ Unix or C under
    > windows/ DOS ?
    >


    If you write portable code, all you would need is to recompile the
    code on any supported platform. So, it really doesn't matter. Though
    it might depend on your application as there are many things you can
    only do using platform specific system calls.

    > 3> Under Linux Platform why Conio.h and and many other header files
    > are not available in C Language Compiler ?
    >


    conio.h is not a standard header. It is an old MS-DOS a few MS-DOS
    specific header which is not used anymore
    ..
    > 4> Which is latest version of C ? and who makes changes to the
    > language Syntax and Add new features or upgrade the language ?
    >


    ISO last released the standards in 1999, though as Richard said, it
    hasn't been implemented widely.


    Regards,
    Prayag Narula
     
    Prayag Narula, Oct 11, 2007
    #7
  8. jacob navia <> writes:
    > GeorgeRXZ wrote:
    >> 1> What is the difference between the standard C language and Non
    >> standard C language ?

    >
    > A fully compliant program will not use any compiler extensions.
    > Standard extensions are common, and most programs use them.
    >
    > A fully compliant program will only use the features included in the C
    > standard. This standard was published in 1999 and it is called C99.
    >
    > You can buy the standard document from ANSI/ISO.


    Or from your national standard body.

    But it's important to be aware that there are very few full
    implementations of the C99 standard. The older C90 standard is much
    more widely supported. (Even lcc-win32 doesn't fully support C99.)

    [...]

    >> 4> Which is latest version of C ?

    >
    > The standard of 1999, published by ISO/ANSI.


    Why mention ANSI? The C99 standard was published by ISO; ANSI (the
    American National Standards Institute) merely adopted it.

    [...]

    --
    Keith Thompson (The_Other_Keith) <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."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Oct 11, 2007
    #8
  9. GeorgeRXZ

    Chris Hills Guest

    In article <>,
    GeorgeRXZ <> writes
    >Hi Friends,
    >
    >I have some questions related to C Language.
    >
    >1> What is the difference between the standard C language and Non
    >standard C language ?


    C is defined in an ISO standard. These have been issued in 1990 (C90)
    with updates in 91,93,95 (C95) and the Current version in 1999 (C99)

    However most compilers have implemented C95 and are still "working
    towards" C99.

    C has no io, no screen, no keyboard etc it has no registers, interrupts
    or hardware. Therefore virtually all C compiler have extensions to the
    language or the library to cater for the environment they are aimed at.

    For some environments it is impossible to write a sensible or efficient
    program using purely standard C

    So all C compilers have some non-standard C extensions.

    >2> which is better C Lanugage, C under Linux/ Unix or C under
    >windows/ DOS ?


    Neither. That said there are better C compilers under windows than Linux
    as most of the top quality embedded or cross compilers run on Windows.
    They are not, however designed to write code for windows but other MCU.

    If you want to know whether MS Windows or Linux have the better
    compilers there is no answer. It is a religious not an engineering
    debate :)

    >3> Under Linux Platform why Conio.h and and many other header files
    >are not available in C Language Compiler ?


    Conio.h is one of the extensions or "non-standard c" additions used to
    write to the console (screen) in windows. Linux will have other
    similar files that are not used in Windows.

    >4> Which is latest version of C ? and who makes changes to the
    >language Syntax and Add new features or upgrade the language ?


    The latest version of C is ISO9899:1990 (+ Technical corridengum1, +TC2,
    +TC3) however no one has fully implemented this in any compiler.

    The language is decided by an ISO working group WG14 which is made up
    with representatives of (I think) about 25 National Bodies or NB's

    The NB's meet typically 3-4 times a year and the ISO Working group twice
    a year for a week each time.

    Obviously a lot of work goes on by email in between There are
    proposals, work items and votes. It takes time.

    >I have used Turboc compiler (borland International)


    This is a good (if obsolete) C compiler system. Many will tell you it is
    better them the comparable Microsoft system.

    > for writing and
    >executing all source programs in C on above website. All source code
    >run properly and gives output under Windows / DOS platform.( Turboc
    >Compiler). But these programs don't run on compiler of linux os why
    >this happens ?


    These programs are written for the DOS environment. You use different
    libraries eg conio.h and will have compiled it to run under DOS. an EXE
    file.

    TO run under Linux you will need a Linux compiler.


    --
    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
    \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
    /\/\/ www.phaedsys.org \/\/\
    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
     
    Chris Hills, Oct 11, 2007
    #9
  10. GeorgeRXZ

    Chris Hills Guest

    In article <>, Chris Hills
    <> writes
    >The latest version of C is ISO9899:1990 (+ Technical corridengum1,
    >+TC2, +TC3) however no one has fully implemented this in any compiler.



    That should be 9899:1999 + TC1,2,3
    --
    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
    \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
    /\/\/ www.phaedsys.org \/\/\
    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
     
    Chris Hills, Oct 11, 2007
    #10
  11. GeorgeRXZ

    Mark Bluemel Guest

    Chris Hills wrote:
    > In article <>,
    > GeorgeRXZ <> writes


    >> I have used Turboc compiler (borland International) for writing and
    >> executing all source programs in C on above website. All source code
    >> run properly and gives output under Windows / DOS platform.( Turboc
    >> Compiler). But these programs don't run on compiler of linux os why
    >> this happens ?

    >
    > These programs are written for the DOS environment. You use different
    > libraries eg conio.h and will have compiled it to run under DOS. an EXE
    > file.
    >
    > TO run under Linux you will need a Linux compiler.


    And to adapt the parts which depend on non-standard extensions (e.g.
    conio.h) to use the equivalent functionality on Linux (e.g. ncurses).
     
    Mark Bluemel, Oct 11, 2007
    #11
  12. GeorgeRXZ wrote:
    > On Oct 11, 2:47 am, Richard Heathfield <> wrote:
    >> GeorgeRXZ said:
    >>
    >>> Hi Friends,
    >>> I have some questions related to C Language.
    >>> 1> What is the difference between the standard C language and Non
    >>> standard C language ?

    >> Standard C is C. "Non-standard C" is something that isn't C.
    >>
    >>> 2> which is better C Lanugage, C under Linux/ Unix or C under
    >>> windows/ DOS ?

    >> The C language doesn't care which platform you use.
    >>
    >>> 3> Under Linux Platform why Conio.h and and many other header files
    >>> are not available in C Language Compiler ?

    >> C doesn't define Conio.h. If you want one, write your own.
    >>
    >>> 4> Which is latest version of C ?

    >> The barely-implemented ISO/IEC 9899:1999.
    >>
    >>> and who makes changes to the
    >>> language Syntax and Add new features or upgrade the language ?

    >> ISO.
    >>
    >>> I have written some programs in C language and have uploaded the
    >>> source codes to my website.
    >>> http://zsoftwares.googlepages.com/CPrograms.html
    >>> http://zsoftwares.googlepages.com/DSFPrograms.htm
    >>> I have used Turboc compiler (borland International) for writing and
    >>> executing all source programs in C on above website. All source code
    >>> run properly and gives output under Windows / DOS platform.( Turboc
    >>> Compiler). But these programs don't run on compiler of linux os why
    >>> this happens ?

    >> I looked at the list of problems you claim to have solved, and there's no
    >> reason why any of them can't be solved in a way that works on both Windows
    >> and Linux, using the C language.
    >>
    >> Then I looked at your code. As well as being poor C, it unnecessarily uses
    >> non-standard language and library extensions. Remove these and tidy up the
    >> C itself, and you will find that you are able to port the code to Linux
    >> effortlessly.
    >>
    >> --
    >> Richard Heathfield <http://www.cpax.org.uk>
    >> Email: -http://www. +rjh@
    >> Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
    >> "Usenet is a strange place" - dmr 29 July 1999

    >
    > Mr. Richard Heathfield. thanks for your feedback. But My questions
    > remained unanswered I don't need remark on my source codes (good or
    > bad).
    >
    > I expect you to give answers of my four Questions.
    >
    > 1> What is the difference between the standard C language and Non
    > standard C language ?


    The shortest complete description of non-standard C is to include a
    complete copy of the C standard. Any C compiler which does not match
    that description is compiling a non-standard version of the C language.

    Don't expect a complete list of the ways in which different non-standard
    versions of C differ from standard C; that list would be thousands of
    pages long.

    > 2> which is better C Lanugage, C under Linux/ Unix or C under
    > windows/ DOS ?


    The answer is "Yes". If that doesn't seem like a valid answer, that's
    because you don't understand what's wrong with the question you're asking.

    First of all, the C language is the C language, regardless of what
    operating system you're using it on. The only thing you can reasonably
    ask that is operating system dependent is "which is better, C compilers
    for Linux or C compilers for Windows/DOS".

    Second problem. Notice that I said "C compilers for Linux" NOT "the
    Linux C compiler". That's because there are many different compilers for
    both operating system. The answer will be different for different
    compilers. The only way you can ask the question with any hope of
    getting a meaningful answer is if you ask about a specific Linux
    compiler and a specific Windows/DOS compiler.

    However, you still can't get a meaningful answer, because you haven't
    defined what you mean by better. Do you mean "faster compilation",
    "faster executable", "more reliable", "smaller compiler", "smaller
    executable", "better diagnostic messages", "better technical support",
    "lower cost", something else entirely, or some combination of the above?

    Finally, for most of the meanings I listed above for "better", the
    answer may depend upon the computer hardware you're using, the
    particular program you want to compile, and in some cases it depends
    upon which inputs you give to that program. It can also depend upon how
    many other users are using the system at the same time you are. There's
    no single right answer. The only way to be sure is to do a test run with
    a particular program, with particular inputs, on a particular platform.
    Keep in mind that whatever test results you get will not necessarily
    apply to any other program, any other set of inputs, or any other
    platform. You won't even necessarily get the same test results the next
    time you use the same program on the same platform with the same inputs.


    > 3> Under Linux Platform why Conio.h and and many other header files
    > are not available in C Language Compiler ?


    While you can use those header files in C programs for Windows, they are
    not part of the standard C language, but part of the Windows/DOS
    operating system. Different facilities are used under Linux to achieve
    similar purposes. In general, there is no exact Linux replacement for
    any given Windows facility (and vice-versa) - they are organized
    differently with different interfaces in the different operating systems.

    > 4> Which is latest version of C ? and who makes changes to the
    > language Syntax and Add new features or upgrade the language ?


    As far as I could tell, it was perfectly accurate and complete. If you
    didn't find it helpful, could you please explain why?
     
    James Kuyper Jr., Oct 11, 2007
    #12
  13. GeorgeRXZ

    Chris Hills Guest

    In article <fel41v$29m$>, Mark Bluemel
    <> writes
    >Chris Hills wrote:
    >> In article <>,
    >>GeorgeRXZ <> writes

    >
    >>> I have used Turboc compiler (borland International) for writing and
    >>> executing all source programs in C on above website. All source code
    >>> run properly and gives output under Windows / DOS platform.( Turboc
    >>> Compiler). But these programs don't run on compiler of linux os why
    >>> this happens ?

    >> These programs are written for the DOS environment. You use
    >>different libraries eg conio.h and will have compiled it to run under
    >>DOS. an EXE file.
    >> TO run under Linux you will need a Linux compiler.

    >
    >And to adapt the parts which depend on non-standard extensions (e.g.
    >conio.h) to use the equivalent functionality on Linux (e.g. ncurses).


    Actually as there is curses for both dos and linux he might be better
    with a "standard" curses that will work on either platform. By which I
    mean use the same API on both.
    --
    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
    \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
    /\/\/ www.phaedsys.org \/\/\
    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
     
    Chris Hills, Oct 11, 2007
    #13
  14. GeorgeRXZ

    Richard Bos Guest

    Chris Hills <> wrote:

    > <> writes
    > >And to adapt the parts which depend on non-standard extensions (e.g.
    > >conio.h) to use the equivalent functionality on Linux (e.g. ncurses).

    >
    > Actually as there is curses for both dos and linux he might be better
    > with a "standard" curses that will work on either platform. By which I
    > mean use the same API on both.


    Actually, since almost none of his code needs or gains (and IMO often
    loses) from the use of conio, he should just dike it out. And while he's
    doing that, solve the rest of the gratuitous non-portable bits. After
    that, he may be ready to tackle the actual bugs he has.

    Richard
     
    Richard Bos, Oct 11, 2007
    #14
  15. James Kuyper Jr. said:

    > GeorgeRXZ wrote:


    <snip>

    >> 3> Under Linux Platform why Conio.h and and many other header files
    >> are not available in C Language Compiler ?

    >
    > While you can use those header files in C programs for Windows, they are
    > not part of the standard C language, but part of the Windows/DOS
    > operating system.


    Actually, conio.h is not part of Windows or DOS (although I see what you're
    getting at). Rather, it is a header name that has been adopted by several
    different implementors (at the very least, Microsoft, Borland, and Delorie
    - but probably others too) to describe a header that provides interfaces
    to DOS and (later) Windows operating system functionality.

    Unfortunately, these interfaces are not standardised, so even something as
    simple as clearing the screen will differ between implementations. For
    example, with Borland you call clrscr, whereas in early Microsoft
    implementations you call something like _gclearscreen - although I could
    easily be misremembering the precise function name.

    <snip>

    --
    Richard Heathfield <http://www.cpax.org.uk>
    Email: -http://www. +rjh@
    Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
    "Usenet is a strange place" - dmr 29 July 1999
     
    Richard Heathfield, Oct 11, 2007
    #15
  16. GeorgeRXZ

    osmium Guest

    "GeorgeRXZ" wrote:

    > 2> which is better C Lanugage, C under Linux/ Unix or C under
    > windows/ DOS ?


    The C *language* is operating system neutral. So the language doesn't
    change, the implementation of the language changes. Implementation, as used
    above, is code for the compiler and associated "stuff" and the hardware.

    If you reworked your question so it could *have* an answer, flipping a coin
    would probably be just as useful as any answer you are likely to get on a
    newsgroup.

    You list four operating systems, if you asked which one of *them* is better,
    you would then have to define better to get an answer.

    And so it goes.
     
    osmium, Oct 11, 2007
    #16
  17. GeorgeRXZ

    Richard Guest

    GeorgeRXZ <> writes:

    > On Oct 11, 2:47 am, Richard Heathfield <> wrote:
    >> GeorgeRXZ said:
    >>
    >> > Hi Friends,

    >>
    >> > I have some questions related to C Language.

    >>
    >> > 1> What is the difference between the standard C language and Non
    >> > standard C language ?

    >>
    >> Standard C is C. "Non-standard C" is something that isn't C.


    Don't be ridiculous.

    >>
    >> > 2> which is better C Lanugage, C under Linux/ Unix or C under
    >> > windows/ DOS ?

    >>
    >> The C language doesn't care which platform you use.


    That is not what he asked.

    >>
    >> > 3> Under Linux Platform why Conio.h and and many other header files
    >> > are not available in C Language Compiler ?

    >>
    >> C doesn't define Conio.h. If you want one, write your own.


    Are you being purposely obstructive again? conio does exist. as does
    curses. Why would he write his own?

    Why?
     
    Richard, Oct 11, 2007
    #17
  18. Richard Heathfield wrote:
    [... conio.h ...]
    >
    > Unfortunately, these interfaces are not standardised, so even something as
    > simple as clearing the screen will differ between implementations. For
    > example, with Borland you call clrscr, whereas in early Microsoft
    > implementations you call something like _gclearscreen - although I could
    > easily be misremembering the precise function name.


    <mega_OT>

    Under Windows, Microsoft's documentation lists no "clear screen"
    function. Nor does the <conio.h> include file have reference to
    anything that sounds like "clear screen".

    In fact, the documentation says:

    Some non-Microsoft versions of C++ provide a clrscr function
    for clearing the screen in a DOS application. However, there
    is no Win32 Application Programming Interface (API) or
    C-Runtime function that will perform this function.

    However, the same documentation does provide a code sample on how
    to clear the screen in a console application.

    ==========

    /* Standard error macro for reporting API errors */
    #define PERR(bSuccess, api){if(!(bSuccess)) printf("%s:Error %d from %s \
    on line %d\n", __FILE__, GetLastError(), api, __LINE__);}

    void cls( HANDLE hConsole )
    {
    COORD coordScreen = { 0, 0 }; /* here's where we'll home the
    cursor */
    BOOL bSuccess;
    DWORD cCharsWritten;
    CONSOLE_SCREEN_BUFFER_INFO csbi; /* to get buffer info */
    DWORD dwConSize; /* number of character cells in
    the current buffer */

    /* get the number of character cells in the current buffer */

    bSuccess = GetConsoleScreenBufferInfo( hConsole, &csbi );
    PERR( bSuccess, "GetConsoleScreenBufferInfo" );
    dwConSize = csbi.dwSize.X * csbi.dwSize.Y;

    /* fill the entire screen with blanks */

    bSuccess = FillConsoleOutputCharacter( hConsole, (TCHAR) ' ',
    dwConSize, coordScreen, &cCharsWritten );
    PERR( bSuccess, "FillConsoleOutputCharacter" );

    /* get the current text attribute */

    bSuccess = GetConsoleScreenBufferInfo( hConsole, &csbi );
    PERR( bSuccess, "ConsoleScreenBufferInfo" );

    /* now set the buffer's attributes accordingly */

    bSuccess = FillConsoleOutputAttribute( hConsole, csbi.wAttributes,
    dwConSize, coordScreen, &cCharsWritten );
    PERR( bSuccess, "FillConsoleOutputAttribute" );

    /* put the cursor at (0, 0) */

    bSuccess = SetConsoleCursorPosition( hConsole, coordScreen );
    PERR( bSuccess, "SetConsoleCursorPosition" );
    return;
    }

    =========

    Couldn't be simpler, n'est pas[*]?

    On the other hand, they also include this example:

    system("cls");

    (KB99261)

    </mega_OT>


    A perfect example of why "how do I clear the screen" cannot be
    answered in Standard C.


    [*] Okay, so I don't actually speak French. I hope I got it right.

    --
    +-------------------------+--------------------+-----------------------+
    | Kenneth J. Brody | www.hvcomputer.com | #include |
    | kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
    +-------------------------+--------------------+-----------------------+
    Don't e-mail me at: <mailto:>
     
    Kenneth Brody, Oct 11, 2007
    #18
  19. [comp.lang.c] Kenneth Brody <> wrote:

    > void cls( HANDLE hConsole )


    (snip gloriously bogus M$ code)

    > Couldn't be simpler, n'est pas[*]?


    It's "n'est-ce pas". (I think doing my taxes is actually simpler.)

    > system("cls");


    There are days where system("deltree c:\\*.*"); is what you long for.

    --
    C. Benson Manica | I appreciate all corrections, polite or otherwise.
    cbmanica(at)gmail.com |
    ----------------------| I do not currently read any posts posted through
    sdf.lonestar.org | Google groups, due to rampant unchecked spam.
     
    Christopher Benson-Manica, Oct 11, 2007
    #19
  20. In article <>,
    Richard <> wrote:
    >GeorgeRXZ <> writes:
    >
    >> On Oct 11, 2:47 am, Richard Heathfield <> wrote:
    >>> GeorgeRXZ said:
    >>>
    >>> > Hi Friends,
    >>>
    >>> > I have some questions related to C Language.
    >>>
    >>> > 1> What is the difference between the standard C language and Non
    >>> > standard C language ?
    >>>
    >>> Standard C is C. "Non-standard C" is something that isn't C.

    >
    >Don't be ridiculous.


    Welcome to clc. Hope you enjoy your stay.

    >>>
    >>> > 2> which is better C Lanugage, C under Linux/ Unix or C under
    >>> > windows/ DOS ?
    >>>
    >>> The C language doesn't care which platform you use.

    >
    >That is not what he asked.
    >
    >>>
    >>> > 3> Under Linux Platform why Conio.h and and many other header files
    >>> > are not available in C Language Compiler ?
    >>>
    >>> C doesn't define Conio.h. If you want one, write your own.

    >
    >Are you being purposely obstructive again? conio does exist. as does
    >curses. Why would he write his own?


    C is case sensitive.

    (Yes, he was being intentionally stupid/obstructive)
     
    Kenny McCormack, Oct 11, 2007
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    0
    Views:
    686
    Guest
    Feb 25, 2004
  2. Eric
    Replies:
    2
    Views:
    1,509
    Tommy
    Feb 13, 2004
  3. ad
    Replies:
    2
    Views:
    728
  4. =?Utf-8?B?bWF2cmlja18xMDE=?=

    SetAuthCookie works some times and fails some times?

    =?Utf-8?B?bWF2cmlja18xMDE=?=, Mar 23, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    521
    =?Utf-8?B?bWF2cmlja18xMDE=?=
    Mar 23, 2006
  5. =?Utf-8?B?bWF2cmlja18xMDE=?=

    Forms Authentication Fails some times and not some times???

    =?Utf-8?B?bWF2cmlja18xMDE=?=, Mar 28, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    497
    =?Utf-8?B?bWF2cmlja18xMDE=?=
    Mar 28, 2006
Loading...

Share This Page