Any online resources for learning C programming?

chiefjason

Vendor and Leather Hack
2A Bourbon Hound 2024
2A Bourbon Hound OG
Vendor
Joined
Dec 18, 2016
Messages
10,814
Location
Longview, NC
Rating - 100%
12   0   0
My oldest daughter is taking Computer Science at WCU. C is kicking her but, again. She does fine on the tests but the assignments/programs are where she is struggling. She's not really getting it with how the Prof is teaching either. Going to him after class doesn't seem to help. Trying to find another resource for her to work through to see if it clicks with her. It won't help for her degree as WCU does not accept outside credits for it. But taking it again, with the same professor is probably not a good path to learning it either.

FWIW, she's the type that will struggle with things even for a long time then one day it just all comes together for her. She's been working hard on this and her other classes. But this one is just not coming together for her.

Thanks.
 
Learned to program C when I was a teenager, used it college and did it professionally for several years. I may be able to help. Does she have any (other) programming experience? C is a bit more structured than “modern” languages like Python or Ruby, and pretty much the antithesis to ones like Perl.

First, to clarify, this is C, not C++ which is a different animal and brings Object Oriented Programming, aka OOP, to C and this is where other languages are better suited in my opinion.

The good news is if you can learn C, you can pick up pretty much any other high level language fairly easy (Example, the web page language PHP is nearly a identical).

What exactly is she having trouble with. Ask her to take a few minutes and try this quiz: https://www.w3schools.com/quiztest/quiztest.php?qtest=C it’s 25 questions that ask about the fundamentals. Don’t worry about the # of answers, but I would like to see if it can help identify what isn’t clicking.

I am sure there are plenty of online resources (that didn’t exist back in the day). The website with the quiz, W3Schools is usually pretty good and has the “try it out” function in the browser.

I see a lot of recommendations for the book Programming: A Modern Approach 2nd Edition, but can’t speak to it without having a look at it.
 
Thanks guys. I'll pass it on.

@noway2 I'll get her to do that after finals. FWIW, this class is a wash. She had a shot until the final project. She just stopped and turned it in incomplete because she needed to focus on other classes. Failing one class is bad. Hurting your grade in other classes to try and save a class you fail anyway is also a bad idea. So she has cut her losses for the semester.

I think she is having issues with "pointers", Addresses, maloc, and calloc. Sounds like pointers and addresses were the big ones. She does fine on the tests it's the application of it in the projects that's her problem.

And I think this is the Prof that does not give them functioning examples. My daughter is good at reverse engineering the projects to figure them out. When she has a functional example she can find her mistakes and fix her problem. Her other Profs do this. He also won't code with the class. He just lectures. And she is a huge visual learner and learns best by doing. His teaching style seems to hit all her weaknesses.
 
Thanks guys. I'll pass it on.

@noway2 I'll get her to do that after finals. FWIW, this class is a wash. She had a shot until the final project. She just stopped and turned it in incomplete because she needed to focus on other classes. Failing one class is bad. Hurting your grade in other classes to try and save a class you fail anyway is also a bad idea. So she has cut her losses for the semester.
Understand. I agree, it sucks, but as the saying goes, don't throw away good money after bad.
I think she is having issues with "pointers", Addresses, maloc, and calloc. Sounds like pointers and addresses were the big ones. She does fine on the tests it's the application of it in the projects that's her problem.
This is arguably one of, if not the, most complex areas of C. One of the things that differentiates C from other languages (such as the ones you mentioned in the post after this, e.g. Python) is that the variables are "strongly typed". What this means is that you need to tell the compiler, in a declaration that the variable x is going to be of type (int, char, float, double), etc. What this does is allow the compiler to efficiently allocate appropriate amounts of memory according to the size of the variable, because different variables can have different sizes and what's more is that the size is platform dependent. As an example, a variable of type 'char' or character will likely be one 'unit' of memory and if the machine uses bytes (8 bits) as it default size a 'char' variable will likely be one byte. A double, as in double precision (extra significant decimal digits) floating point will be bigger, such as 8 bytes.

The point is that by "typing" the variables, the compiler knows how to allocate memory.

Where things get weird, or actually quite powerful, but in ways that can also get you into deep doo-doo is that C allows you to access variables in a de-references fashion, with what are called pointers. For example, if we have a variable x of type int (integer) the compiler will store it at some random address. We can also have a variable of type int* (a pointer to an int) that holds the address of x, (y = &x, meaning y equals the address of x) and we can access the variable x in oblique ways using it.

This concept ties into arrays, and especially when you get into multi dimensional arrays. The arrays are nothing more than several memory boxes of some type stacked together and you can logically stack them in multiple dimensions (though they're just laid out flat in the computer memory). The tricky part, and the part the teachers love to put on the tests, are having you show the output of a bit of code that loops through these arrays in some fashion. It's a lot of stuff to hold in your head all at once.
And I think this is the Prof that does not give them functioning examples. My daughter is good at reverse engineering the projects to figure them out. When she has a functional example she can find her mistakes and fix her problem. Her other Profs do this. He also won't code with the class. He just lectures. And she is a huge visual learner and learns best by doing. His teaching style seems to hit all her weaknesses.
That's possible. It's also possible he's one of "those" types. I had one that you needed to know this 'trick' that wasn't taught in the text book to solve 4 out of 5 test problems. It was a simple trick but he wouldn't teach it, I think you needed to go to his office and somehow negotiate with him and no surprise the only student who understood the topic was the one female whose day job as at a strip club. One day someone asked him to show us an example. He took the chalk and eraser, went to the corner of the chalk board, did the tiniest example while hiding it with his hands, quickly erased it, and then turned around, smiled and said, "See how easy that is?". (I wish I had a cell phone camera back then - and I would have reported him).
@noway2 talking to here now. She has done classes for Python, Java, Java Scripts, MIPs some, SQL in database this semester. And a couple variants of Java.
Ah, sounds like she speaks my kind of language. Interesting that they are teaching MIPs still, which was taught when I went to CWRU in the early 2000s. It's a pretty neat and simple assembly language. (side note, computers only speak in numbers, ones and zeros, specifically, and they follow a set of algorithms in processing them. One of the lowest (not quite the lowest) language is called machine code, which are these ones and zeros - think punch card type level. A step up from this is called assembly which uses pneumonic and codes to abstract this and make it more human readable. A compiler like C takes the even higher level language and breaks it down into assembly).

Python is a very common, easy to learn, language used heavily today. It's syntax is similar to C, but it does all the variable 'typing' for you behind the scenes. The exchange penalty is that C can be made to run faster. Never got into Java much, it had it's hey day back in the late 90s I think. Java Script is a language that runs on the client (your) side of the web browser, an SQL, which stands for Structured Query Language, is used to pattern match to get data from a database. With it, you can ask things like "select and display all the CFF users whose handle begins with chief".
Also, I understand nothing of what I just typed.
Ha ha. No worries.
 
Rosetta code has decent explanations of various concepts by language usually with examples

May be helpful also

 
The only programming I ever did was with Fortran, going on 40 years ago now, and then only for a specific purpose.

HOWEVER, I do have a couple learning suggestions.

When I failed a Calculus class in college, I retook it in a "Maymester" course Purdue University offered. Maymester courses were semester length courses offered in the month of May...an entire semester's worth of work in those four weeks. It was a way to recover a course without adversely impacting your planned degree path by requiring you to retake a class in the following semester or year. It was AMAZING to me how much easier Calculus was for me as a Maymester course, because it was the ONLY class I had going on at that time and 100% of my study time was free to focus on that class alone.

That said, if WCU offers something similar, she ought to look into it. She might also look into it as a summer school class for the same reason. (Looking back, I believe I missed opportunities to make things easier in following semesters by taking some courses as Maymester and/or summer school in order to lighten my course load for the following semesters.)


ALSO...in addition to something online (or even books...do they still make those "...For Dummies" books?), she might see about some side tutoring from someone else. I learned that some things require a very methodical approach, and even a different teaching methodology, than some people may get in a class or teacher. My son had some issues with math for a while and was exceptionally frustrated as a result. We sat down at a table and collectively made up a single page list of math rules, and their order of priority, and then we went through how to apply each.

In a couple hours of one day, I had him up to speed having gotten him to work through several math problems in his homework as examples of how to apply them. I told him "When you get stuck, refer back to this list. It's OK to look at the list because homework is literally open book with the purpose of learning what rules to apply and how to apply them. You only need to memorize them for your tests. And once you've done the homework and gained an understanding, you'll be able to more easily memorize the rules for the tests."

I left him to finish his homework and once in a while he'd holler out in frustration for help. "Did you look back at the list?" "No..." "Well, do that and if you still have problems, let me know."

When he was done (without any further assistance from me, by the way) he paid me an awesome parent compliment: "You make this so much easier to understand than my teacher!"

Sometimes what's needed is to demonstrate practical uses in real life. Applying torque with different wrenches. Showing how you can use a tape measure to check the square of a door you're making. Calculating how much sand/gravel/concrete/dirt is needed for a project. Whatever.


Finding an effective tutor who is able to break things down understandably is invaluable. Sometimes, that's all it takes.

Especially for someone like your daughter who is "the type that will struggle with things even for a long time then one day it just all comes together for her".
 
Last edited:
Back
Top Bottom