Want to learn C (or C++ or Pro*C) - any tips?

Sharky Forums


Page 1 of 2 12 LastLast
Results 1 to 15 of 26

Thread: Want to learn C (or C++ or Pro*C) - any tips?

  1. #1
    Hammerhead Shark
    Join Date
    Aug 2001
    Posts
    2,240

    Question Want to learn C (or C++ or Pro*C) - any tips?

    I am looking into learning (self-teach) C or C++ (or even Pro*C) but don't know where to start. I'm a complete newcomer to this - the only vaguely related experience I have is VBA and SQL.

    To start with, what is the difference between C, C++ and Pro*C? I would prefer a high level explanation since I am not familiar with any of the terminology. Which of the three is most commonly used and which is the best (if different to the most common one)?

    Now, how do I go about learning to any of those languages? Which tools would I need (Visual Studio??) to start with?

    Any help would be greatly appreciated. Please note, I am not familiar with the terminology (hence I got stuck when browsing the net for help - printf and scanf, etc).

    Thanks
    | AMD64 3000+ (skt 754)| 256MB Sapphire Radeon 9600XT | MSI K8N Neo Platinum | 450W Antec SP-450PGB PSU |Corsair 1024MB CMX1024-3200C2PT + TwinMOS PC3200 512MB CL2.5 | 80GB WD SE HDD (8MB Cache) | 180GB IBM/Hitachi 180GXP HDD | NEC 2500A DVR+-RW | Creative FPS1000 Speakers |
    Share on Google+

  2. #2
    NullPointerException rock's Avatar
    Join Date
    Sep 2000
    Location
    York, PA
    Posts
    6,203
    Teach Yourself C in 24 hours

    Actually, a google of "teach yourself c" will lead to a bunch of C and C++ sites with some good intro material. Of course, the real books show up too.

    C is the core language. It's been around since the 80s and is probably the most ubiquitous language. In the C language, the "++" terminology means increment by one, and so "C++" is supposed to be one better than C. Nerd humor at work there. C++ is different because it is object-oriented (classes, methods) instead of procedural (top-down with subroutines). Pro*C is special in that it's tied to SQL, so SQL statements are compiled with some outside library and then the rest of the C/C++ code is compiled normally.

    If you're writing on Windows in C++, Visual Studio is the tool to start with (but it isn't free). If you're into learning the language and not an IDE, start with DevC or even just gcc and a text editor.

    Open Source is free like a puppy is free.

    It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames.

    Understanding Evolution
    Share on Google+

  3. #3
    Catfish gameboy1234's Avatar
    Join Date
    Aug 2002
    Posts
    238
    Um, C has been around officially since 1974, when the Unix operating system was announced by Bell Labs and AT&T. Unofficially, it was created in 1971 and '72 and Unix was re-written in C in 1972. (Before that, Unix was written in an interpeted language called B. It was REALLY SLOW. )
    Share on Google+

  4. #4
    NullPointerException rock's Avatar
    Join Date
    Sep 2000
    Location
    York, PA
    Posts
    6,203
    True, C started in the 70s, but it really didn't take off until after K&R's book was published in '78. And wasn't standardized by ANSI until sometime in the mid '80s.

    Open Source is free like a puppy is free.

    It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames.

    Understanding Evolution
    Share on Google+

  5. #5
    Hammerhead Shark
    Join Date
    Aug 2001
    Posts
    2,240
    Thanks for the link rock. Searching google finds all sorts of useless links......and many useful ones which have some good aspects. the link you gave however seems to cover the very basics I was after. I will have a look through when I get a chance.

    So, if C has been around for so long how comes it's survived? Is it that powerful?

    Also, which is better C or C++? I assume there is no such thing as just C+

    Thanks
    | AMD64 3000+ (skt 754)| 256MB Sapphire Radeon 9600XT | MSI K8N Neo Platinum | 450W Antec SP-450PGB PSU |Corsair 1024MB CMX1024-3200C2PT + TwinMOS PC3200 512MB CL2.5 | 80GB WD SE HDD (8MB Cache) | 180GB IBM/Hitachi 180GXP HDD | NEC 2500A DVR+-RW | Creative FPS1000 Speakers |
    Share on Google+

  6. #6
    Goldfish Emon0's Avatar
    Join Date
    Jun 2003
    Posts
    71
    C and C++ have been around so long because their low level capabilities and speed make them such awesome multi-purpose languages.

    I'd recommend learning C++. A well written C++ book or tutorial set will start you with procedural C style stuff and you'll get into object oriented stuff later. At least that's how I liked learning it. When you learn one, you basically learn the other, they are so similar. C++ is probably the way to go for two reasons. One, it's a superset of C, it's got everything C has and more. Any C program can usually be easily converted to C++, it's usually just small syntax or fuction names that change, and some stuff that newer compilers demand. Object oriented programming is just overall a better, safer, easier way to do things, at least in the eyes of many. Hell, you learn one object oriented language, you learn them all they say. C, C++ and Java are quite similar (with Java being very class heavy). PHP and Perl are easy to pickup after learning C or C++, too.
    Share on Google+

  7. #7
    NullPointerException rock's Avatar
    Join Date
    Sep 2000
    Location
    York, PA
    Posts
    6,203
    I'd have to agree. Unless in the long run you're definitely going to be doing procedural programming (e.g., Fortran or 4GL languages like Matlab or PV-WAVE), C++ will be the place to start. From C++ it's much easier to move to Java and C#, too.

    Open Source is free like a puppy is free.

    It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames.

    Understanding Evolution
    Share on Google+

  8. #8
    Hammerhead Shark
    Join Date
    Aug 2001
    Posts
    2,240
    Ok, starting to get a little lost again. How many different variants of C are there?

    C
    C#
    C+ (does this exist?)
    C++
    Pro*C

    Any others? Also, what's the difference between C and C#?

    | AMD64 3000+ (skt 754)| 256MB Sapphire Radeon 9600XT | MSI K8N Neo Platinum | 450W Antec SP-450PGB PSU |Corsair 1024MB CMX1024-3200C2PT + TwinMOS PC3200 512MB CL2.5 | 80GB WD SE HDD (8MB Cache) | 180GB IBM/Hitachi 180GXP HDD | NEC 2500A DVR+-RW | Creative FPS1000 Speakers |
    Share on Google+

  9. #9
    Reef Shark
    Join Date
    Apr 2002
    Location
    Virginia Tech/ Glenwood, Maryland
    Posts
    430
    C# is the illegitimate son of Java and C. Basicly C# is an object-oriented language while C is procedural. C# also has a lot more built in libraries that C does and is used more in the real world for business solutions than C. I began by learning C++ and once you know C++, C# is easy, C is annoying cuz C++ does just as much, and you really don't need to know anything about the others.

    C+ does not exist

    to increment a variable by 1 in C++ you type
    myVar++; // this increments myVar by one so 1 now is 2

    so C++ is meant to be C + 1
    Last edited by TheSpegmaster; 05-26-2004 at 10:54 AM.
    Pentium 4 2.8GHz w/ 1MB L2 cache
    ASUS P4P800-E Deluxe
    1024MB PC3200 DDR RAM (Dual Channel)
    ATI Radeon 9800 Pro w/ 128MB DDR
    8x NEC DVD-RW
    16x Samsung DVD-ROM
    120GB Samsung 7200 RPM SATA
    120GB Western Digital 7200 RPM
    Asound 4 Ports Nway Switch
    Netgear WG111 54 Mbps Wireless USB 2.0 Adapter

    3dMark2001 SE: 16183 Marks
    3dMark2003 : 5798 Marks
    Share on Google+

  10. #10
    Catfish gameboy1234's Avatar
    Join Date
    Aug 2002
    Posts
    238
    C is not powerful. It is elegant, simple and fast, which is why it's been around for so long. It's an ideal system (low level) programming language.

    C++ is more of a higher level language. It's far more bloated but has many features that make it attractive for large projects with large teams. It's also a more recent invention so it has many modern features, so it would be a great place to start.

    I didn't notice anyone mention tools yet. MS has released the command line tools for Visual C++ for free:
    http://msdn.microsoft.com/visualc/vctoolkit2003/

    I like the MinGW compiler instead, which is a native port of the GNU compiler:
    http://www.mingw.org

    MinGW also has other GNU tools in their Msys package, which I like as well.

    Finally, IDE editors are evil. Use gvim. http://www.vim.org
    Share on Google+

  11. #11
    NullPointerException rock's Avatar
    Join Date
    Sep 2000
    Location
    York, PA
    Posts
    6,203
    FYI, the SDK for the .NET framework is a free download on MSDN too. So you can compile any of the .NET languages (C#, VB.NET and C++.NET) from the command line. Of course, it's a lot easier with Visual Studio.NET.

    linkage

    Open Source is free like a puppy is free.

    It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames.

    Understanding Evolution
    Share on Google+

  12. #12
    Hammerhead Shark SprySpectre's Avatar
    Join Date
    Apr 2004
    Location
    audio nirvana...
    Posts
    1,251
    C++ is my language of choice. Self taught it to myself as a freshman in highschool 4 years ago, and have been pleased with it since. It is much more capable than C, hence the step up (++). I learned from SAMS Teach Yourself C++ in 21 Days--it did a good job of explaining everything in easy to understand terminology, and didn't get me lost in details. From there, stick around on forums like this if you have questions, there are always people here to help.
    Audio Setups:
    E-MU 0404 ---toslink---> Panasonic SA-XR55s ---> Ascend Acoustics CBM170's with Dayton 12"
    E-MU 0404 ---analog---> Little Dot II tube amp ---> Beyerdynamics DT880 or Sennheiser HD280 pros.
    Technics SL-1200 MKII ---> TCC TC-750LC Phono Preamp ---> Panasonic SA-XR55s ---> Ascend Acoustics CBM170's with Dayton 12"


    Proud Sharky Folding@Home member! (Rank 37 and counting...)
    Share on Google+

  13. #13
    Hammerhead Shark
    Join Date
    Aug 2001
    Posts
    2,240
    Thanks for all the help guys.

    I checked out the Teach Yourself C in 24 Hours site and it seems pretty good so far. The only slight downside is that the author uses Visual C++ v1.5 with the latest version at the time of writing being v5. I have v6. Also, all of the picture links are dead (probably because the site is very old)

    Is there a similar site but where the author uses Visual C++ v6? Being an absolute beginner I am not at all familiar with the software so it would be very handy to follow the guide where the same software is being used. For example, I tried compiling the code below (from the Teach Yourself C in 24 Hours site) and got completey lost in Visual C++ . Create a new project? What is a project? Which type do I need? etc etc

    Code:
    1:  /* INL01.c: Read input by calling getc() */
    2:  #include <stdio.h>
    3:
    4:  main()
    5:  {
    6:     int ch;
    7:
    8:     printf("Please type in one character:\n");
    9:     ch = getc(stdin);
    10:    printf("The character you just entered is: %c\n", ch);
    11:    return 0;
    12: }
    I am probably being way too fussy, but it would be great if a similar guide but using Visual C++ 6 could be found. I say a similar guide because the Teach Yourself C in 24 Hours site is really good (thanks for the link rock).

    Thanks for the help.
    | AMD64 3000+ (skt 754)| 256MB Sapphire Radeon 9600XT | MSI K8N Neo Platinum | 450W Antec SP-450PGB PSU |Corsair 1024MB CMX1024-3200C2PT + TwinMOS PC3200 512MB CL2.5 | 80GB WD SE HDD (8MB Cache) | 180GB IBM/Hitachi 180GXP HDD | NEC 2500A DVR+-RW | Creative FPS1000 Speakers |
    Share on Google+

  14. #14
    NullPointerException rock's Avatar
    Join Date
    Sep 2000
    Location
    York, PA
    Posts
    6,203
    Instead of trying to figure out Visual Studio, you might want to start with something simpler like Dev-C++. With their docs and your sample code you should be able to get going.

    Open Source is free like a puppy is free.

    It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames.

    Understanding Evolution
    Share on Google+

  15. #15
    Hammerhead Shark
    Join Date
    Aug 2001
    Posts
    2,240
    Thanks rock. Downloading Dev C++ 5 as I type. Also found this site:

    Teach Yourself Visual C++ 6 in 21 Days
    | AMD64 3000+ (skt 754)| 256MB Sapphire Radeon 9600XT | MSI K8N Neo Platinum | 450W Antec SP-450PGB PSU |Corsair 1024MB CMX1024-3200C2PT + TwinMOS PC3200 512MB CL2.5 | 80GB WD SE HDD (8MB Cache) | 180GB IBM/Hitachi 180GXP HDD | NEC 2500A DVR+-RW | Creative FPS1000 Speakers |
    Share on Google+

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •