Thread: Learning C

  1. #1
    Registered User
    Join Date
    May 2007
    Posts
    13

    Learning C

    Does anyone know some good tutorial on the internet for C? Or can someone reccomend me a good book for C. Thank you.

  2. #2
    Registered User OnionKnight's Avatar
    Join Date
    Jan 2005
    Posts
    555
    I actually learned C from this site.

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Ivor Horton's "Beginning C".

    Kernighan & Ritchie "The C Programming Language", this one is full of short, intense "body blows to your brain". Not for the meek -- bring on the geek, or stay home on this one.

    Barnes & Nobles has a collection of colorful and small mini-books, on a variety of subjects. The one for C was quite nice. Cheap as anything, too. About $9.00 as I recall (but I don't remember the title to the book, so the facts may be at odds with that). This is a VERY gentle tutorial book, but it also covers a lot of the nuts and bolts of doing things. A sample function/program on almost every page.

  4. #4
    Linux is where it's at movl0x1's Avatar
    Join Date
    May 2007
    Posts
    72
    Yes. First learn assembly langauge and binary and hexadecimal. Then you'll know C.

    Actually, download GNU C tutorial in pdf or whatever format. It's really a good tutorial.

    Or yeah, Ivor Horton is a great C book author.
    Remember that all that code you write turns into this:

    0100100100110010010011100100111001001
    0010100100100001001111100010010010010 ....

  5. #5
    Registered User
    Join Date
    May 2007
    Posts
    13
    I have found some great e-books but when i copy and paste the code that is in the book into my compiler it works. But when i write it by myself it doesnt work. Why is that?

  6. #6
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    Perhaps you should show us what code your have written?

    ssharish2005

  7. #7
    Registered User
    Join Date
    Mar 2007
    Location
    Bangor, Northern Ireland
    Posts
    6
    Hi All,

    For anyone wanting to learn C using the WIN32 API have a look at this site, all to do with webcams.

    http://uk.geocities.com/ecafin/index.html

    Tutorials and source code included. A good method of learning C.

    Regards to all

    Eric132

  8. #8
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    Quote Originally Posted by Eric132 View Post
    Hi All,

    For anyone wanting to learn C using the WIN32 API have a look at this site, all to do with webcams.

    http://uk.geocities.com/ecafin/index.html

    Tutorials and source code included. A good method of learning C.

    Regards to all

    Eric132
    The OP was expecting a basic tutorial on how to learn C language. He is suppose to be starter of C.

    But a good tutorial

    ssharish2005

  9. #9
    Registered User
    Join Date
    May 2007
    Posts
    13
    I have tried to write this program.
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    
    #define BOILING 212     /* degrees Fahrenheit */
    
    main(){
          float f_var; double d_var; long double l_d_var;
          int i;
    
          i = 0;
          printf("Fahrenheit to Centigrade\n");
          while(i <= BOILING){
                  l_d_var = 5*(i-32);
                  l_d_var = l_d_var/9;
                  d_var = l_d_var;
                  f_var = l_d_var;
                  printf("%d %f %f %lf\n", i,
                          f_var, d_var, l_d_var);
                  i = i+1;
          }
          exit(EXIT_SUCCESS);
    }

  10. #10
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    
    #define BOILING 212     /* degrees Fahrenheit */
    
    main(){
          int f_var; 
          float d_var; 
          float l_d_var;
          int i;
    
          i = 1;
          printf("Fahrenheit to Centigrade\n");
          while(i <= BOILING){
                  d_var = (i - 32) ;
                  d_var = d_var / 9.0;
                  f_var = d_var * 5;
    
                  printf("&#37;d %d \n", i, f_var);
                  i = i+1;
          }
          getchar();
          exit(EXIT_SUCCESS);
    }
    ssharish2005

  11. #11
    Mistake is a way to learn
    Join Date
    Sep 2006
    Location
    Malaysia
    Posts
    11
    Quote Originally Posted by ssharish2005 View Post
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    
    #define BOILING 212     /* degrees Fahrenheit */
    
    main(){
          int f_var; 
          float d_var; 
          float l_d_var;
          int i;
    
          i = 1;
          printf("Fahrenheit to Centigrade\n");
          while(i <= BOILING){
                  d_var = (i - 32) ;
                  d_var = d_var / 9.0;
                  f_var = d_var * 5;
    
                  printf("%d %d \n", i, f_var);
                  i = i+1;
          }
          getchar();
          exit(EXIT_SUCCESS);
    }
    ssharish2005
    Well, i thought it would be better if we learn C using some more standardised code?
    I mean like this one:
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    
    #define BOILING 212     /* degrees Fahrenheit */
    
    int main(){
          int f_var; 
          float d_var; 
          float l_d_var;
          int i;
    
          i = 1;
          printf("Fahrenheit to Centigrade\n");
          while(i <= BOILING)
          {
                  d_var = (i - 32) ;
                  d_var = d_var / 9.0;
                  f_var = d_var * 5;
    
                  printf("%d %d \n", i, f_var);
                  i = i+1;
          }
          getchar();
          return 0;
    }
    Well, this is just my suggestion though. I'm still learning it too.
    Hope u can find some learning C

  12. #12
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    return 0 or return EXIT_SUCCESS is fine

    Most books use return 0 though
    Double Helix STL

  13. #13
    Registered User Tommo's Avatar
    Join Date
    Jun 2007
    Location
    Scotland
    Posts
    101
    This is a good tutorial

    Also, I did a
    Code:
    $ wget -H -r --level=1 -k -p http://www.cs.cf.ac.uk/Dave/C/index.html
    to save it for offline viewing/learning.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Machine Learning with Lego Mindstorms
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 01-30-2009, 02:34 PM
  2. Best Approach for Learning
    By UCnLA in forum C Programming
    Replies: 5
    Last Post: 03-21-2008, 02:35 AM
  3. Need Help On a Simple Bank Program
    By oobootsy1 in forum C# Programming
    Replies: 9
    Last Post: 08-08-2005, 10:51 AM
  4. Fun Learning a New Language
    By UnregdRegd in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 09-30-2003, 10:03 PM
  5. Learning Rate Of C++
    By Krak in forum C++ Programming
    Replies: 27
    Last Post: 01-29-2003, 01:53 PM