Learning to program in C

Discussion in 'Software' started by mdowns, Mar 21, 2005.

  1. mdowns

    mdowns Private First Class

    Hello folks! :)

    I have a copy of C for Dummies, and I'd like to use it to learn how to program in C. I downloaded Microsoft's Visual C++ 2005 Express Edition Beta cause I thought I'd be able to use it to do the linking and compiling and such (I still don't have much of a handle on what those things mean). I can't seem to figure the program out, though. It won't let me save things as c programs, only as cpp programs. Also, I can't really figure out how to compile my files or run them or whatever.

    So, is there an easier, more dumb-noob friendly compiler out there? Free would be best! :)

    Also, if you have any tips for a complete beginner, please speak up.

    Thanks.
     
  2. MBlock

    MBlock Private E-2

    If the compiler you have is for C++ have you thought about maybe picking up a little C++ programming first? You can find tutorials (free) all over the net... I think I found C++ to be easier than C... and it was a little easier for me to understand C after already learning C++ so granted I haven't been down the road of learning C first.... is there any reason that it HAS to be C that you learn or could you do C++? Also, I am starting to learn Visual Basic which is real easy to pick up but again I had a strong C++ background becuase that's where I started it all
     
  3. mdowns

    mdowns Private First Class

    Thanks for the reply MBlock.

    I just figured that since I had the book, I'd start with C. I also figured that since C came first that it would be easier to learn C++ after. Maybe I'm wrong on that.

    The thing with the Microsoft compiler is that it says it's a C/C++ compiler, but I just can't figure out where the C compiler is.

    But, if you suggest that C++ is easier than C, then maybe I should give C++ a try. Really, I'm not set on one...I just had the book. So, for C++, do you have any recommendations for a beginners C++ book? Remember, I am a complete noob with this. I mean, I know nothing about programming. ;)
     
  4. MBlock

    MBlock Private E-2

    Well lets see... being completly new at it I'd definatly recomend one of those "teach yourself C++ in X ammount of days" books (maybe like 30 days or something like that) you clearly don't need to learn it that fast but I tend to like the structure of those books because they step you through everything nicely unlike say a text book where each chapter isn't necissarily linked to the previous... so definatly a book that says teach yourself in so many days... Sam's makes a good one but the title escapes me.

    The main reason I suggest C++ depends on what you wanna do with the knowledge. Because C is such a low level language that it's MOSTLY used by us engineers for calculations and very repetitive things. If you wanted to get into anything other than calculations it becomes much harder to do in C. So I suggested C++ because it's much more versatile and as far as my opinion goes it's one of the most powerful languages out there, there's so much you can do with it. easiest being like text based games like there used to be back in the day. So like I mentioned before I think that if you were serious about learning a programming language C++ would be a good start and then once you get the hang of that maybe try Visual Basic. I only say that because I just started playing around with VB and it's a fun one much more graphical than C++ :) but C++ builds a good versatile foundation.

    Also feel free to get opinions elsewhere I am just speaking from what's worked for me my programming history started at C++ and then I got the hang of that... tried a little bit of C and really didn't care for it.. and then found Visual Basic for my job and some stuff I have to write and I really like it. And tackling Java in the summer so that's coming soon lol. So that's just the path I took and it seemed to work for me it WAS slightly frustrating and disheartining at first cuz your like "AH how am I gonna remember all this?!" but you just keep doing it and it becomes old hat... seriously like learning spanish or french.. eventually it makes sense... so.. hope that helps direct you and lemme know if you have any other questions!
     
  5. mdowns

    mdowns Private First Class

    Thanks for the info, MBlock! :)

    I'll definitely try out C++ then. I'm not an engineer, so I don't have much use for calculations and such.

    I'll check out some books, and probably be back here with questions!

    Thanks again.
     
  6. Tonglebeak

    Tonglebeak Specialist

    Just learn java and dont' worry with c >_>
     
  7. QuickSilver

    QuickSilver Corporal

    For learning either C or C++ I would strongly recommend using a lighter weight compiler. Most of your early programs will run in a DOS environment - this will provide a comfortable environment to learn the basics of programming (things like flow control, and loops, and data types, etc etc are carried across a lot of the higher level languages).

    What you are using is capable of doing a lot more than what you need at the moment and I suspect this is why you are a bit over whelmed by how to accomplish some things... There are plenty of light weight compilers out there that will allow you get straight to work on what you are interested in - eg programming, without worrying about the in's and out's of the compiler...

    I believe Borland are giving away some of their early compilers without cost and you can probably find some of these on the net...

    For a very lightweight compiler I use gcc. This is command line driven - consider the command 'gcc myprog.c -o myprog'. That takes your C program and compiles it to an executable called myprog. (And if I recall C For Dummies your first program should be goodbye.c ???? ) ;)
    gcc is available on Windows under the Cygwin bash shell...

    Thats my 2 cents anyway... good luck!
     
  8. Robster12

    Robster12 The Horse Whisperer

    Right on!
    I am learning C now, and am learning on gcc!
    Definitely a good choice, I think!
     
  9. mdowns

    mdowns Private First Class

    Hey Quicksilver. Thanks for the input. I searched for GCC (I think I'd come across that proggy before), and I found their web-page. But, it seemed like most of the install files were for Linux systems. I found the link to Cygwin, though. But, I am confused. If I install Cygwin, does that include GCC as well? Or would I need to install a copy of GCC using Cygwin?

    I've also seen a couple of the Borland free give aways, but I can't get them to work right. Don't really know what I'm doing wrong there.

    Finally, if I do get GCC running (I think I would prefer to get that running, since I have been fooling around with Linux lately) in Windows, to compile a text file, all I need to do is run the "compile command" you suggested from the command line?
     
  10. QuickSilver

    QuickSilver Corporal

    Yea Cygwin is essentially a bash shell (Bourne Again Shell) that can be run from Windows... a lot of the useful linux commands run under there and you treat your system as if it were Linux - 'cd /' instead of 'cd \'...

    When you go to install cygwin you'll go to a page where you can select what is installed (binaries/source) for many many many packages. Under development I think you'll find gcc... just select all the one's that look liek they may be it... the page automatically gets the pre-req packages that you'll need as well...

    Once its installed you can knock together your code in notepad and save it somewhere... or even vi if yo uwant... then gcc should be working like in the example i provided...

    Hope this helps
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds