C

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • abi

    #1

    C

    hi,
    i have a c program in notepad. How to convert it or how to compile
    it?

  • arkmancn@gmail.com

    #2
    Re: C


    abi wrote:
    hi,
    i have a c program in notepad. How to convert it or how to compile
    it?
    You can compile with mingw-gcc for win32, like this
    >gcc -Wall -c abi_c.c [Enter]
    This will compile your c program, and generate one corresponding
    object file if your program has no error.

    OR

    Create a project with VS2005, and build it.

    Comment

    • Road Tang

      #3
      Re: C

      abi wrote:
      hi,
      i have a c program in notepad. How to convert it or how to compile
      it?
      >
      The first chapter of the most tutorial is how to compile and run.
      So what's you need mostly is a formal tutorial of C.

      It's also a good idea to google some for it.


      HTH
      Road
      --
      C FAQ: http://c-faq.com/

      Comment

      • user923005

        #4
        Re: C

        On Oct 22, 6:27 pm, Richard Heathfield <r...@see.sig.i nvalidwrote:
        [snip]
        2) If you don't have a C compiler installed, install one. You can find a
        list of free C compilers here:
        >
        http://www.cpax.org.uk/prg/portable/...#FreeCompilers
        Don't forget Watcom C:




        Comment

        • Richard Heathfield

          #5
          Re: C

          user923005 said:
          On Oct 22, 6:27 pm, Richard Heathfield <r...@see.sig.i nvalidwrote:
          [snip]
          >2) If you don't have a C compiler installed, install one. You can find a
          >list of free C compilers here:
          >>
          > http://www.cpax.org.uk/prg/portable/...#FreeCompilers
          >
          Don't forget Watcom C:
          >
          http://www.openwatcom.org/index.php/Download
          Thank you. Duly added.

          --
          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

          Comment

          • Richard

            #6
            Re: C

            user923005 <dcorbit@connx. comwrites:
            On Oct 22, 6:27 pm, Richard Heathfield <r...@see.sig.i nvalidwrote:
            [snip]
            >2) If you don't have a C compiler installed, install one. You can find a
            >list of free C compilers here:
            >>
            > http://www.cpax.org.uk/prg/portable/...#FreeCompilers
            >
            Don't forget Watcom C:
            >
            http://www.openwatcom.org/index.php/Download
            It's good to finally see the stalwarts being a little more open minded
            and answering what would previously have been called "Off Topic".

            Comment

            • santosh

              #7
              Re: C

              abi wrote:
              hi,
              i have a c program in notepad. How to convert it or how to compile
              it?
              Convert it to what?

              First save your program to a file. Then invoke your system's C compiler
              and pass this file as it's source file. Your compiler and it's support
              programs must be in your executable search path.

              Comment

              • santosh

                #8
                Re: C

                Richard Heathfield wrote:
                abi said:
                >
                >hi,
                > i have a c program in notepad. How to convert it or how to
                > compile
                >it?
                >
                "This is the big hurdle", as Brian Kernighan rightly said. Everything
                else in C is relatively simple by comparison.
                <snip>

                I personally found this to be the smallest hurdle in learning C.

                Comment

                • Richard

                  #9
                  Re: C

                  santosh <santosh.k83@gm ail.comwrites:
                  Richard Heathfield wrote:
                  >
                  >abi said:
                  >>
                  >>hi,
                  >> i have a c program in notepad. How to convert it or how to
                  >> compile
                  >>it?
                  >>
                  >"This is the big hurdle", as Brian Kernighan rightly said. Everything
                  >else in C is relatively simple by comparison.
                  >
                  <snip>
                  >
                  I personally found this to be the smallest hurdle in learning C.
                  Yes, but like that rubbish about debugging being twice as hard as
                  writing it right in the first place, if it comes from the mouth of a
                  "great" it must be true according to some.

                  Compiling a simple program is, of course, easy to anyone capable of
                  reading. Understanding C and designing programs to utilise its core
                  strengths is not.

                  Comment

                  • Richard Heathfield

                    #10
                    Re: C

                    santosh said:
                    Richard Heathfield wrote:
                    >
                    >abi said:
                    >>
                    >>hi,
                    >> i have a c program in notepad. How to convert it or how to
                    >> compile
                    >>it?
                    >>
                    >"This is the big hurdle", as Brian Kernighan rightly said. Everything
                    >else in C is relatively simple by comparison.
                    >
                    <snip>
                    >
                    I personally found this to be the smallest hurdle in learning C.
                    It has rightly been said that the distance between 0 and 1 is greater than
                    the distance between 1 and 1000. (Your mileage may vary. Mathematicians
                    need not apply. May contain nuts.)

                    When I first learned C, I did so by taking a 13-week course. We were given
                    quite a few days of classroom stuff before we were let loose on a
                    computer. Our first task was "hello, world". We didn't have to install the
                    compiler - that had already been done for us, thank heaven.

                    One of the people in the class (a very promising student, it seemed to the
                    rest of us) got quite a few (I think it was 13) compilation errors. He got
                    up and walked out of the lab, and we never saw him again.

                    We all know that he's probably made just one mistake, or possibly two -
                    maybe a missing semicolon, maybe a 0 instead of a ), or whatever. Had he
                    fought his way over that hurdle, I'm sure he would have made a perfectly
                    good C programmer. But it was too big a *perceived* hurdle for him.

                    I stand by my original statement. Compared to the challenge of getting
                    "hello world" up and running, *especially* if nobody has been kind enough
                    to install a compiler for you, the rest of C is relatively simple.

                    --
                    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

                    Comment

                    • santosh

                      #11
                      Re: C


                      Richard Heathfield wrote:
                      santosh said:
                      >
                      Richard Heathfield wrote:
                      abi said:
                      >
                      >hi,
                      > i have a c program in notepad. How to convert it or how to
                      > compile
                      >it?
                      >
                      "This is the big hurdle", as Brian Kernighan rightly said. Everything
                      else in C is relatively simple by comparison.
                      <snip>

                      I personally found this to be the smallest hurdle in learning C.
                      <snip>
                      I stand by my original statement. Compared to the challenge of getting
                      "hello world" up and running, *especially* if nobody has been kind enough
                      to install a compiler for you, the rest of C is relatively simple.
                      In practically every C course I can think of, a ready to use compiler
                      and environment were provided. If someone is going to learn C at home,
                      then he ought to familiarize himself with the basic usage of
                      computers, (manipulating files, installing programs etc.), before
                      attempting to learn C.

                      In summary what you say would be true only in two cases, (I can think
                      of):

                      1. Attempting to learn C before learning the basics of using
                      computers.
                      2. Attempting to write your first program before getting the basics of
                      C syntax down pat.

                      Comment

                      • Kenneth Brody

                        #12
                        Re: C

                        santosh wrote:
                        >
                        Richard Heathfield wrote:
                        [...]
                        >"This is the big hurdle", as Brian Kernighan rightly said. Everything
                        >else in C is relatively simple by comparison.
                        [...]
                        I stand by my original statement. Compared to the challenge of getting
                        "hello world" up and running, *especially* if nobody has been kind enough
                        to install a compiler for you, the rest of C is relatively simple.
                        >
                        In practically every C course I can think of, a ready to use compiler
                        and environment were provided. If someone is going to learn C at home,
                        then he ought to familiarize himself with the basic usage of
                        computers, (manipulating files, installing programs etc.), before
                        attempting to learn C.
                        >
                        In summary what you say would be true only in two cases, (I can think
                        of):
                        >
                        1. Attempting to learn C before learning the basics of using
                        computers.
                        Considering how many people try to use computers before learning the
                        basics of using computers, I think the field is pretty wide open for
                        this one.
                        2. Attempting to write your first program before getting the basics of
                        C syntax down pat.
                        As I recall, I created/compiled/ran "Hello world" before I knew much
                        about C beyond the first few pages of K&R.

                        Yes, I was quite familiar with programming in general, having already
                        been self-taught in numerous languages. Yes, I knew how to use the
                        computer, and was able to install the C compiler, and use a text
                        editor.

                        Even so, there was a certain little thrill the first time the compile
                        worked and the "Hello world" message appeared on my screen when I ran
                        the program.

                        Nowadays, when people are spoon-fed pre-installed IDEs which can make
                        a complete "project" for you at the click of a button or two, I can't
                        see someone getting that same thrill.

                        I still agree with Mr. Heathfield, however.

                        --
                        +-------------------------+--------------------+-----------------------+
                        | Kenneth J. Brody | www.hvcomputer.com | #include |
                        | kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer .h|
                        +-------------------------+--------------------+-----------------------+
                        Don't e-mail me at: <mailto:ThisIsA SpamTrap@gmail. com>


                        Comment

                        • santosh

                          #13
                          Re: C

                          Kenneth Brody wrote:
                          santosh wrote:
                          >>
                          >Richard Heathfield wrote:
                          [...]
                          >"This is the big hurdle", as Brian Kernighan rightly said.
                          >Everything else in C is relatively simple by comparison.
                          [...]
                          I stand by my original statement. Compared to the challenge of
                          getting "hello world" up and running, *especially* if nobody has
                          been kind enough to install a compiler for you, the rest of C is
                          relatively simple.
                          >In summary what you say would be true only in two cases, (I can think
                          >of):
                          >>
                          >1. Attempting to learn C before learning the basics of using
                          >computers.
                          >
                          Considering how many people try to use computers before learning the
                          basics of using computers, I think the field is pretty wide open for
                          this one.
                          >
                          >2. Attempting to write your first program before getting the basics
                          >of C syntax down pat.
                          >
                          As I recall, I created/compiled/ran "Hello world" before I knew much
                          about C beyond the first few pages of K&R.
                          >
                          Yes, I was quite familiar with programming in general, having already
                          been self-taught in numerous languages. Yes, I knew how to use the
                          computer, and was able to install the C compiler, and use a text
                          editor.
                          In my estimation the difficulty of entering, saving, compiling and
                          running a "hello world" program has nothing to do with C and all to do
                          with the details of operating the system.

                          In which case, if for someone, this was their greatest challenge in
                          learning C, I can only conclude that they attempted to learn C before
                          becoming adequately familiar with their system.

                          I personally started programming about a year after I started on
                          computers, so this wasn't a problem to me. Also modern computing
                          environments are significantly more intuitive and easier to operate
                          than in the days of K&R.

                          Still this type of difficulty typically arises when someone starts on
                          programming without being familiar with more basic operations like
                          editing files, using the commandline and so on.

                          <snip>

                          Comment

                          • Larry__Weiss

                            #14
                            Re: C

                            Richard Heathfield wrote:
                            santosh said:
                            >
                            >Richard Heathfield wrote:
                            >>
                            >>abi said:
                            >>>
                            >>>hi,
                            >>> i have a c program in notepad. How to convert it or how to
                            >>> compile
                            >>>it?
                            >>>
                            >>"This is the big hurdle", as Brian Kernighan rightly said. Everything
                            >>else in C is relatively simple by comparison.
                            >>
                            ><snip>
                            >>
                            >I personally found this to be the smallest hurdle in learning C.
                            >
                            It has rightly been said that the distance between 0 and 1 is greater than
                            the distance between 1 and 1000. (Your mileage may vary. Mathematicians
                            need not apply. May contain nuts.)
                            >
                            When I first learned C, I did so by taking a 13-week course. We were given
                            quite a few days of classroom stuff before we were let loose on a
                            computer. Our first task was "hello, world". We didn't have to install the
                            compiler - that had already been done for us, thank heaven.
                            >
                            One of the people in the class (a very promising student, it seemed to the
                            rest of us) got quite a few (I think it was 13) compilation errors. He got
                            up and walked out of the lab, and we never saw him again.
                            >
                            We all know that he's probably made just one mistake, or possibly two -
                            maybe a missing semicolon, maybe a 0 instead of a ), or whatever. Had he
                            fought his way over that hurdle, I'm sure he would have made a perfectly
                            good C programmer. But it was too big a *perceived* hurdle for him.
                            >
                            I stand by my original statement. Compared to the challenge of getting
                            "hello world" up and running, *especially* if nobody has been kind enough
                            to install a compiler for you, the rest of C is relatively simple.
                            >
                            I never have found string handling to be simple in any sense in C.
                            Perhaps it's just a personal flaw or blind-spot, but having to
                            explicitly do the memory management makes it inherently not simple for me.

                            - Larry

                            Comment

                            • Peter Pichler

                              #15
                              Re: C

                              Larry__Weiss wrote:
                              I never have found string handling to be simple in any sense in C.
                              Perhaps it's just a personal flaw or blind-spot, but having to
                              explicitly do the memory management makes it inherently not simple for me.
                              <OT>
                              You haven't programmed on Symbian, have you? Their string handling makes
                              C strings look not only simple, but also beautiful.
                              </OT>

                              Comment

                              Working...