#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    10
    Rep Power
    0

    Finally starting with c tomorrow


    though this should have been a long ago but, my c classes are starting from tomorrow and i dont know what compiler to use.
    i use a windows 7 64 bit system.
  2. #2
  3. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,172
    Rep Power
    2222
    Your instructor/school probably will tell you what compiler you're expected to use. They might even require you to use that compiler. One reason for such a requirement is so that your instructor can teach you how to use that compiler/IDE (integrated development environment, which combines editor, compiler, linker, debugger, project management, file management, etc). Another reason would be that not all compilers comply to all the current standards. Yet another reason would be that it can be almost impossible for the instructor to respond to students' problems in using their particular compiler if they're all using different compilers and/or different versions. You'll find out tomorrow which compiler is required or recommended.

    If you are given a free choice in the matter, look into Microsoft's Visual C++ Express Edition. You can download and use it for free. It doesn't have all the features of the ones that you would have to pay for, but it does have the features that you will need, plus it has an excellent debugger.

    On the matter of compliance to standards, the current standard is from 2011 (C11) and the previous standard is from 1999 (C99), though the standard that all the professionals I know of use is from 1989 (C89, AKA "ANSI C") -- to us, C89 is C. Microsoft does not support C99 nor C11, because most of what they've added is already in C++ and it's C++ that Microsoft wants to support. So if your class teaches C99, then Visual C++ won't work for you. Again, tomorrow in class you will learn what compiler to get.
  4. #3
  5. No Profile Picture
    Still Learning
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Location
    Montreal, Canada
    Posts
    55
    Rep Power
    39
    There is a C11 compliant compiler for windows called Pelles C. It's free.

    http://www.smorgasbordet.com/pellesc/

    I have been using it for a few months.
  6. #4
  7. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,172
    Rep Power
    2222
    If your instructor does not have a required compiler, then you can shop around, using Wikipedia as a guide.

    If it needs to support C99, then consult http://en.wikipedia.org/wiki/C99. The Implementations section is a table of several compilers and a description of whether they support C99. Although the links in that table are to Wikipedia articles on those compilers, those pages usually also link you to the compiler's home page. A number of compilers are free. After researching some of them (or just coming up with a list), then you could ask us for our opinions.

    The article on C11 (http://en.wikipedia.org/wiki/C11_(C_standard_revision)) does not have an implementations table, but it's so new I'd be very surprised of many compilers supported it yet.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    10
    Rep Power
    0
    thanks guys, for all the suggestions. i am using dev c++ for now atleast.
    did some basic programming and some few if else loop programs.
    feeling good after completing all of them.
    it was very easy this far lets see for tomorrow.
    Thanks
  10. #6
  11. No Profile Picture
    I haz teh codez!
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2003
    Posts
    2,549
    Rep Power
    2337
    Congrats; you picked the second-worst option (first-worst being Turbo C). Dev-C++ is old, buggy, and no longer supported.
    I ♥ ManiacDan & requinix

    This is a sig, and not necessarily a comment on the OP:
    Please don't be a help vampire!
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    10
    Rep Power
    0
    Originally Posted by ptr2void
    Congrats; you picked the second-worst option (first-worst being Turbo C). Dev-C++ is old, buggy, and no longer supported.
    what would be a better choice.
    can i go for visual c++
  14. #8
  15. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,392
    Rep Power
    1871
    Try one of these:

    Visual studio from Microsoft, free but with some string attached.
    http://www.microsoft.com/express/Downloads/

    http://www.smorgasbordet.com/pellesc/

    These two use the MinGW port of GCC to run on Windows.
    The last one is an updated fork of the old dev-cpp (according to the blurb)
    http://www.codeblocks.org/
    http://sourceforge.net/projects/orwelldevcpp/
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  16. #9
  17. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Location
    Manila, Philippines
    Posts
    64
    Rep Power
    5
    @salem:
    Also on my Intro to C course. Thanks for the info about the Orwell update. Our professor prefers Dev-C++.
  18. #10
  19. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,172
    Rep Power
    2222
    Originally Posted by subhobose0003
    what would be a better choice.
    can i go for visual c++
    Then that is in agreement with your course requirements? As you will recall, my main concern was whether the instructor required using a particular compiler or at least one which supports C99, which Visual C++ does not.

    Visual C++ is a good choice in that it has an excellent debugger and you gain experience with a development environment used by professionals. The down-side is that it takes more work to create a C project:
    1. Create a new project. You must be absolutely sure that you create a console application and that you choose for it to be an empty project. It is very important to specify a console app, because otherwise it will create a Windows project which is a very different beast; we've gotten a number of cries for help because of that mistake, though it's been a while since the last one.

    2a. Add a new item to the project, the source file. However, there is no option for a C source file, so you need to choose the C++ source file. Then you need to rename it with a .c extension so that the compiler will compile it as C. And you will need to clean up the program skeleton that Visual C++ creates for you, or even completely replace it -- almost trivial after the first few times.

    or
    2b. Create the C source file with another editor, save it as a .c in the project's source code directory, and use the Add Existing Item menu option to add it to the empty project.

    Admittedly, that second approach doesn't make much sense when creating a new program, but I have used it a few times helping people on this forum when I had to run their code through a debugger, so I'd create an empty project, copy their source code into the project's directory, and added it as an existing item.


    I also installed Dev-C++ years ago and almost immediately had to give up on it. I tried using it do to Windows programming, but the IDE was too buggy and would always disable controls that I needed to use.

    However, I do continue to use the compiler that came with Dev-C++, the MinGW port of gcc. It is quick and easy to use for quick little programs to test something or for trying to run programs from this forum as part of my help efforts here. I simply use my favorite text editor (NoteTab Pro) to write the program, open a console (AKA "DOS window", AKA "Cmd Prompt") and chdir to where I saved the program, and run gcc from the command line.

    So you do have the option of installing more than one free compiler on your system. That means that even if your instructor did require you to use a particular compiler for the class (eg, Turbo C, Dev-C++), that would not keep you from also installing Visual C++ Express Edition. The only thing to watch out for is that if you double-click on a C source file in Windows Explorer in order to open it, Windows will have assigned a compiler to that file extension and will open that program.

    Also, when you post a question here about a problem you're having with one of your programming assignments, be sure to tell us what compiler you're using.
  20. #11
  21. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Location
    Manila, Philippines
    Posts
    64
    Rep Power
    5
    Hi guys,

    I was checking Orwell's official blogspot and came across "MinGW" and "TDM-GCC". What is the difference of the two and which setup should I get?
  22. #12
  23. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    10
    Rep Power
    0
    Originally Posted by dwise1_aol
    Then that is in agreement with your course requirements? As you will recall, my main concern was whether the instructor required using a particular compiler or at least one which supports C99, which Visual C++ does not.

    Visual C++ is a good choice in that it has an excellent debugger and you gain experience with a development environment used by professionals. The down-side is that it takes more work to create a C project:
    1. Create a new project. You must be absolutely sure that you create a console application and that you choose for it to be an empty project. It is very important to specify a console app, because otherwise it will create a Windows project which is a very different beast; we've gotten a number of cries for help because of that mistake, though it's been a while since the last one.

    2a. Add a new item to the project, the source file. However, there is no option for a C source file, so you need to choose the C++ source file. Then you need to rename it with a .c extension so that the compiler will compile it as C. And you will need to clean up the program skeleton that Visual C++ creates for you, or even completely replace it -- almost trivial after the first few times.

    or
    2b. Create the C source file with another editor, save it as a .c in the project's source code directory, and use the Add Existing Item menu option to add it to the empty project.

    Admittedly, that second approach doesn't make much sense when creating a new program, but I have used it a few times helping people on this forum when I had to run their code through a debugger, so I'd create an empty project, copy their source code into the project's directory, and added it as an existing item.


    I also installed Dev-C++ years ago and almost immediately had to give up on it. I tried using it do to Windows programming, but the IDE was too buggy and would always disable controls that I needed to use.

    However, I do continue to use the compiler that came with Dev-C++, the MinGW port of gcc. It is quick and easy to use for quick little programs to test something or for trying to run programs from this forum as part of my help efforts here. I simply use my favorite text editor (NoteTab Pro) to write the program, open a console (AKA "DOS window", AKA "Cmd Prompt") and chdir to where I saved the program, and run gcc from the command line.

    So you do have the option of installing more than one free compiler on your system. That means that even if your instructor did require you to use a particular compiler for the class (eg, Turbo C, Dev-C++), that would not keep you from also installing Visual C++ Express Edition. The only thing to watch out for is that if you double-click on a C source file in Windows Explorer in order to open it, Windows will have assigned a compiler to that file extension and will open that program.

    Also, when you post a question here about a problem you're having with one of your programming assignments, be sure to tell us what compiler you're using.
    Thanks for sharing this information with me, i think i now get it. though can u explain again how to use the command prompt, i didn't get it properly.
    thanks again
  24. #13
  25. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,172
    Rep Power
    2222
    Uff da! (a Norwegian expression I picked up while in North Dakota)

    I am 61 years old. At the age of 24 (Sep 1976), I enlisted in the US Air Force as an Electronic Computer Systems Repairman. In the winter of 1978, I enrolled in the local university's computer science program. In 1980 I completed my degree and in 1982 I started working professionally as a "software engineer". A few years later, I bought my first IBM PC clone and circa 1987 I was working extensively in MS-DOS.

    Let me get Biblical for a moment here: In the Beginning there was the command prompt.

    For a very long time, all you had was the "command prompt." Even further back than I can go, all you had was a terminal which was little more than a teletype. You entered a line of input and it output lines of output. Nothing at all like the present-day GUI interfaces.

    What are you using? Windows? Somewhere, there must be a "Cmd Prompt" icon or something like that. If not, then run the program: Windows-R (which runs a program), cmd (which is the command-line "shell" of choice; there's also COMMAND.COM, but that's way too old-school). OK, that dumps you into a directory somewhere. At this point, you need to know something about your directory structure.

    The command to change directory is chdir, which is better known as cd. On the C: drive, there is a root directory, which is called \ . All other directories stem out from that root. All your CD commands depend on where your directories are.

    Now the question comes to your executable paths. From the command line, enter the command, PATH. That is our search path. That is to say that when you enter a command from the command line, the computer will search through that search path in that order to find that command.

    Here is my batch file ( devcpp.bat ) placed in the existing search path:
    path=c:\dev-cpp\bin;%PATH%
    Once you have that, you should be able to run gcc from the command line.
  26. #14
  27. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    10
    Rep Power
    0
    sorry guys, had been off for a few days b'coz of all the things going on. but getting back to work from tomorrow. starting again with c. thanks

IMN logo majestic logo threadwatch logo seochat tools logo