Sites for learning C?


Does anyone know of a site that I can lookup to in order to learn C? My teacher hasn’t taught us shit and I already need to compile a program soon. So I was hoping that some one can provide a good place to learn…


the best source would probably be your textbook. some are better than others, but just read through and do exercises. plenty of good sites out there, quick search gave me this:


my teacher’s site is the best. she posts clear examples and lecture notes. she’s the best instructor at my college. i don’t even need a textbook.


You got the link? It sounds like it would help really nice. And I have to do a program that can do find areas under curves (not quite integrals, but another forumula)


get the “C Programming Language” book (by W. Kernigang and Dennis Ritchie). I still keep my copy and it has become very handy.


Very very handy book. If you are going to learn C or C++ you should probably get this just to make the whole process easier.


Thirded. Best C book ever, reference or learning.

Isnt it kinda late in the semester to compile your first program???


4th week of the quarter. The course isn’t entirely on programming (the course is “C in Computer Systems”) The first three weeks talked more about circuits. We haven’t gone m much into programming till this week.


There’s a reference library for you.


For standard C, get K&R now. It’ll take you at most a week to read, you’ll get leveled up quick, and it’ll be an invaluable reference on the basics for the rest of your programming life.

Also MSDN for Windows-centric C programming.

What are the required readings in the course?
Also, any O’Reilly reference is usually great.

“C in Computer Systems” sounds pretty generic. What are you actually trying to learn?

EDIT: And what is this program supposed to do?


i’m in an intro to c programming class dude. I’m not sure my notes will help you. that sounds like an advance program you’re compiling. anyway i think they assumed you know the basics already.

anyway i will pm the notes.


is basically what they are trying to have me do. Does this look like it would be easy for a newbie for C, or is this program really more designed for those that have C knowledge?


hmmm trapeziodal rule to find the area under the curve. that’s the first assignment? I don’t think a newbie will be able to handle that right away. i had to do that on excel in my engineering class and math class. looks like stuff i will be doing later so check my notes on the latest ch.


that’s basically what it is. A sample code was given to get us started, but I am having a hard time understanding what the code is trying to do:


That code just takes care of getting the arguments from the command line and putting them into variables. He wants you to fill it with code that will compute whatever the answer is based on the arguments given on the command line.


Not trying to hijack your thread, but I have a C question that I’m hoping someone can help with. Actually, more a pre-processor & macro question.

Im writing for a microcontroller that has 5 different input/output ports(A…E), and each port has 8 bits (0…7). Each port has different structs that represent different memory locations controlling the pins behavior (PORTA is an unsigned char showing/controlling the high or low status of each bit/pin, TRISA controls whether it’s an input or output, LATA controls the latch to change the HIGH/LOW output state.) I’m trying to make macros that would make this easier to use.

For a single example, we have the one pin, RA2. I know that the bits that affect it are the bits at PORTAbits.RA2, TRISAbits.TRISA2, and LATAbits.LATA2. I would like to make a #define like:

#define Output_Pin_7 RA2
#define Console_Neogeo_Down Output_Pin_7

Is there any way to manipulate the string to get those three struct pieces from the ‘RA2’ defined in the first line? something like:

#define tConsole_Neogeo_Down (magic here that turns 'RA2' into TRISAbits.TRISA2)
#define pConsole_Neogeo_Down (magic here that turns 'RA2' into PORTAbits.RA2)
#define lConsole_Neogeo_Down (magic here that turns 'RA2' into LATAbits.LATA2)

Sucky thing is I know I could do it with a smidge of Perl and a simple RegEx, but I wanted to keep it using the preprocessor that came with MPLAB IDE, and not requiring Perl to be installed.