Thread: is C appropriate or adequate for my specific use?

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    18

    Question is C appropriate or adequate for my specific use?

    I want to learn C programming (reason: microprocessor programming in electrical engineering), but I want to get a head-start and learn the jargon and basic skills before school starts. So I got my hands on a student's licence of MS Visual Studio 2010.
    I want to make a 'game' that can handle internet communications, dice-rolling, login features, super-users, multiple concurrent users and some other stuff, including a Windows-interface.

    So my question is: Can I use C programming language for this, or do I need to step it up to use C++? Can MS VS 2010 compile properly C language?

  2. #2
    Registered User
    Join Date
    Mar 2011
    Posts
    546
    MS VS 2010 can compile C properly, with the exception of C99 which it doesn't support. for embedded microprocessor programming, C is a common, probably predominant language. on the other hand, for game programming on Windows, C++ has many more frameworks available to make that sort of programming easier.

  3. #3
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    As always VS is a crap IDE choice for working in C. It is far too bloated with features that will slow you down rather than increase your productivity simply because:
    a) you don't know what they are and how to use them
    b) even if you do know what they are you don't need them for your development.
    Use Pelles or Codeblocks instead. They are much simpler to learn and to use and will allow you to spend more time programming and less time fiddling with the environment.

    As for your approach to learning C I think you are getting ahead of yourself a bit. You don't jump into learning how to drive by going 100mph on a motorway on your first lesson. Similarly, you don't learn how to program by making a program that you think is complex enough to touch on every single concept that you want to learn. The effect in the first case will be that you will most likely crash the car and die and in the second you will probably be frustrated that nothing is working and give up learning programming altogether.

    In addition to all of this, I think you should learn programming in a system independent fashion and not get bogged down to specific system libraries. You are trying to learn C not every single feature of the Windows API.

    In conclusion, I warmly recommend starting the tutorials on this site first. See if you can do the exercises, and who knows, answer some questions on a thread or two. Start slowly and build on that.

    Best of luck to you!
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  4. #4
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    I want to get a head-start and learn the jargon and basic skills before school starts.
    Wonderful. ^_^

    Wait. O_o

    What does "microprocessor programming" have to do with "a 'game' that can handle internet communications, dice-rolling, login features, super-users, multiple concurrent users and some other stuff"?

    Seriously, these are differently specialties with different jargon, standards, expectations, and libraries. Why are you venturing so far in a different direction?

    Soma

  5. #5
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    > or do I need to step it up to use C++?
    I wouldn't say that C++ is a direct improvement of C, and I certainly wouldn't imply that C++ can do things that C cannot. Both languages are compiled down to machine code, and while C++ may offer an easier solution to some problems, it certainly isn't a "step up" from C.

    > So I got my hands on a student's licence of MS Visual Studio 2010.
    You should ask before you buy something like this. There's many good free compilers/IDEs out there for Windows, and if the ones that have been already suggested don't meet your standards, there's always GCC which is command-line only but (imo) one of the best compilers out there.

    Also, MSVS isn't that great, and you probably wasted a lot of money on it, considering that there are free alternatives. On the other hand, the first two results that come up for MSVS are a version for $499.99, and a seemingly similar version for $11,899.00, both on Microsoft's store. Leave it to MS to try and pawn off mediocre software for the price of a cheap car.

  6. #6
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    Student's license may well mean that is was free.

    Also, I would say MSVS is the best windows IDE for C++. I'm not sure what that makes it for C (with lack of C99 support and all), but it's pretty good.
    Last edited by King Mir; 07-23-2012 at 05:09 PM.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  7. #7
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    As to what the OP should do, if you want to learn C, trying to make a game is a great way to do it. My advice: get your textbook early and use it to learn C. Don't rely on online tutorials. If you can't find what textbook your courses will actually use, get any highly recommended C book.

    Don't try C++ to start off. Starting with C's good since you have specific motivation to learn C. You could also start with a language like Python, which is easier to start, and so you'll be doing cooler things sooner and make learning C later easier. That's up to you: do cool things soon with python, or take things slower with C so you can do cool things with C sooner.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  8. #8
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,907
    I'm an Electronic Engineer and practice my programming using a free program that this site recommends called "Code::Blocks". I think that you have the right idea getting the jump start on class.

    My advice is to stick with C, unless you are going to be programming with the Arduino.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Non-specific homework help
    By rcplguy15 in forum C++ Programming
    Replies: 9
    Last Post: 08-13-2010, 05:40 AM
  2. Platform Specific...
    By Cheeze-It in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 09-29-2002, 01:48 AM
  3. Accessing a specific bit
    By Zewu in forum C++ Programming
    Replies: 7
    Last Post: 07-02-2002, 07:55 AM
  4. Specific question
    By Shiftytitan702 in forum Game Programming
    Replies: 5
    Last Post: 05-02-2002, 01:32 PM
  5. having specific users
    By izimmer in forum C Programming
    Replies: 2
    Last Post: 04-25-2002, 11:13 PM