Learn C Programming: Tips for Engineering Student

  • Thread starter AK2
  • Start date
In summary, as an engineering undergraduate student, I am currently learning C language which is crucial for my degree program. I am using the book Sam's Teach Yourself C in 21 days, but I have only covered 10 out of the 21 chapters so far. It has been frustrating and I am looking for the best way to learn C programming. I have read that C is known as a "programmer's programmer language" and it is the first computer program that I am learning. Some advice has been to practice coding and to try small programs for practice and to stay motivated. Others have recommended the book "The C programming language" by Kernighan & Ritchie for its concise and valuable content, including practice problems and examples. Another
  • #1
AK2
39
0
I'm presently an engineering undergraduate student. Learning C language is very important for my degree program. I'm using Sam's Teach Yourself C in 21 days. Its obvious I can't learn C in 21 days. I have covered 10 chapters out of the 21 chapter book. Its kind of frustrating learning C that I had to slow down my pace and look through the first 10 chapters. So what is the best way to learn C programming. I read some where that C is a programmer's programmer language. C is the first computer program I am learning. Any advice will be welcome
 
Technology news on Phys.org
  • #2
AK2 said:
So what is the best way to learn C programming.

The same way a violinist gets to Carnegie Hall: "Practice, practice, practice!"
 
  • #3
AK2 said:
I'm presently an engineering undergraduate student. Learning C language is very important for my degree program. I'm using Sam's Teach Yourself C in 21 days. Its obvious I can't learn C in 21 days. I have covered 10 chapters out of the 21 chapter book. Its kind of frustrating learning C that I had to slow down my pace and look through the first 10 chapters. So what is the best way to learn C programming. I read some where that C is a programmer's programmer language. C is the first computer program I am learning. Any advice will be welcome

Throw the book out through the window and start to code.
 
  • #4
jtbell said:
The same way a violinist gets to Carnegie Hall: "Practice, practice, practice!"
I have been practicing but I'm losing interest. Are there any sites where I can get problems to practice on since I've done all the problems in the chapters I have covered so far.

DanP said:
Throw the book out through the window and start to code.

How will that help me?
 
  • #5
AK2 said:
I have been practicing but I'm losing interest. Are there any sites where I can get problems to practice on since I've done all the problems in the chapters I have covered so far.
How will that help me?

You can't learn swimming from books. You actually have to get in the water at some point.
The same is with coding. You actually need to write code to learn it well.
Sit at your computer. Your C compiler should have a reference, use that for help and write code. Again and again.

The only "difficult" thing in C with which I seen ppl (who never programmed in any language before) having issues with are the pointer mechanism, & and * operators, and array addressing. Type conversions should be easy. Rest of C is self-explanatory.

If you are bored with problems, start to write small programs. Find something which excite your imagination and make a program :P
 
  • #6
DanP said:
You can't learn swimming from books. You actually have to get in the water at some point.
The same is with coding. You actually need to write code to learn it well.
Sit at your computer. Your C compiler should have a reference, use that for help and write code. Again and again.

The only "difficult" thing in C with which I seen ppl (who never programmed in any language before) having issues with are the pointer mechanism, & and * operators, and array addressing. Type conversions should be easy. Rest of C is self-explanatory.

If you are bored with problems, start to write small programs. Find something which excite your imagination and make a program :P

Thanks. I will take into practice what you just posted.
 
  • #7
AK2 said:
...I'm using Sam's Teach Yourself C in 21 days...
The best book I know is the first one: "The C programing Language", by Kernighan & Ritchie (the fathers of the C language).
No several equivalents examples, not twice the same thing. It is a concise book, and each line is valuable.
 
  • #8
Kittel Knight said:
The best book I know is the first one: "The C programing Language", by Kernighan & Ritchie (the fathers of the C language).
No several equivalents examples, not twice the same thing. It is a concise book, and each line is valuable.

Does it have a lot of practice problems and examples. I need something like that to master C at a faster pace.
 
  • #9
AK2 said:
Does it have a lot of practice problems and examples. I need something like that to master C at a faster pace.

Yes it does have practice problems and examples throughout the book. I highly recommend it.
 
  • #10
AK2 said:
Does it have a lot of practice problems and examples.
Yes. The authors work through the examples and put a bunch of practice problems at the end of every chapter. It's also really clear and concise (a model of good technical writing), which makes it much easier to get through.
 
  • #11
AK2 said:
Does it have a lot of practice problems and examples. I need something like that to master C at a faster pace.

pheeesics said:
Yes it does have practice problems and examples throughout the book. I highly recommend it.

Thanks. I'm ordering the book now.
 
  • #12
AK2 said:
I have been practicing but I'm losing interest. Are there any sites where I can get problems to practice on since I've done all the problems in the chapters I have covered so far.

http://projecteuler.net/

This is a good site irrespective of what language you are studying. It starts up with quite simple problems but eventually they become quite difficult.
 
  • #13
I have been practicing but I'm losing interest. Are there any sites where I can get problems to practice on since I've done all the problems in the chapters I have covered so far.

The approach of just keeping with the sample C programs is an admirable one. However if you really are having trouble focusing on the C examples you may want to consider learning a "simpler" language, like Python or Java, and then coming back to C when you have a better grasp of programming fundamentals.

There are kind of two things you really need to learn, one is "how to program", the other is how to program in C. It is perfectly possible to learn both at once. But for some people trying to start out with C, with its added requirements (compared to some languages) of understanding how memory addresses and allocation work just to do basic things with strings, obscures what you really need to learn about programming. It's also the case that doing certain "real things" (like, I don't know, editing a PNG) become possible lower on the learning curve with some of those other languages, which may make it easier to maintain that focus.
 
  • #14
write some programs that you can use: a hex dumper, a program that reads a text file and numbers the lines, a syntax colorer, etc
 
  • #16
I found C very easy after I learned assembly language.
 
  • #17
@rootX: I've heard a lot of people comment that C *is* pretty much the same as assembly language. It does not permit you not to know everything about what is happening within the memory.
 
  • #18
K & R The Computer Langauge book is advanced for me. The good thing is that it has a lot of problems. I will probably start with it after I've finished the one I am using now which is a book for novices. I'm on the chapter on structures and I'm finding it to be a very interesting topics. Thanks for the responses.
 
  • #19
for all language c is base so that c should study perfectly by getting book of local author so that you can understand easily also make use of w3school website that too helps lot and lot
 
  • #20
A great book is Herb Shildt's "C++: The Complete Reference"

C is not a great language to start with. You would have definitely benefitted from learning Basic or something first. However, you will get through it. Practice writing little console apps to do things like Conway's Game of Life, etc. Start small and work your way up. Good luck.
 
  • #21
technoweasel said:
A great book is Herb Shildt's "C++: The Complete Reference"

C is not a great language to start with. You would have definitely benefitted from learning Basic or something first. However, you will get through it. Practice writing little console apps to do things like Conway's Game of Life, etc. Start small and work your way up. Good luck.

I agree with you that C is not a great language to start with. I had to look at time constraint. I decided I have to learn C at once because I'm an engineering student and we use C to program microcontrollers. We also use matlab. I'm planning to finish learning all the chapters in the book I'm using to learn C and pick up and start learning matlab. I read a post by a programmer stating that once I learn C picking up another language will be easy.
 
  • #22
I have a somehow related question, and didn't want to start a separate thread.

I need to take a programming sequence as a requirement for my degree, and chose C++. However, the courses are offered in a different campus that is further away from where I take my other courses. It's also offered as an online course, and I thought that maybe I can do that. I studied Turbo Pascal in high school and was quite good at it. I still remember all of the concepts of programming, so I have a feeling that taking C++ online won't be such a problem.

Is that a mistake? I thought about trying it online, and if it's too hard I'll just ask to take in class. I know that it sounds like I've already decided to take it online, and in fact I did, but if it's a big mistake then I'll reconsider.
 
  • #23
C++ is going to be a LOT more of a problem to learn than Pascal (which is type safe). I highly recommend that you go to the class.
 
  • #24
If it's a technically introductory course, and the first such course you've had in awhile... I wouldn't take chances. It can be very useful to have the teacher right there to ask questions of. This is assuming you have a half decent teacher.
 
  • #25
rootX said:
I found C very easy after I learned assembly language.

I'll ditto that. With C it is very important to understand what is happening, rather than how to code. Once you understand what all these concept are, you will semi-master C:

What is a variable? If you say int x = 2, where is that 2 stored? What if you say x = y, what is going on in memory or registers?

What does it mean to declare a pointer? What is difference between a reference (variable) and a pointer. What does a pointer store?

What is the meaning of static keyword for variables. What about functions?

What is stack and heap

What is the scope of every function and/or variable in the program.
 

Related to Learn C Programming: Tips for Engineering Student

1. What is C programming?

C programming is a general-purpose, high-level programming language that was developed by Dennis Ritchie in the early 1970s. It is a powerful and efficient language commonly used for system and application programming.

2. Why should engineering students learn C programming?

C programming is an essential language for engineering students as it provides a strong foundation in programming concepts and logic. It is also widely used in the industry, especially in embedded systems and operating systems, making it a valuable skill for job opportunities.

3. What are some tips for learning C programming?

To learn C programming effectively, it is important to practice regularly and start with the basics. It is also helpful to work on coding projects and seek guidance from experienced programmers. Additionally, using online resources and joining coding communities can also aid in learning.

4. What are some common challenges for engineering students learning C programming?

One of the main challenges for engineering students learning C programming is grasping the concept of pointers, which can be confusing at first. Another challenge is understanding the syntax and structure of the language, as it can be quite different from other programming languages.

5. How can C programming benefit engineering students in their studies?

C programming can benefit engineering students by improving their problem-solving skills and logical thinking. It also allows them to develop efficient and optimized algorithms, which are essential for engineering applications. Additionally, learning C programming can also help students in their future careers as engineers.

Similar threads

  • Programming and Computer Science
2
Replies
69
Views
5K
  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
4
Replies
107
Views
6K
  • Programming and Computer Science
Replies
15
Views
2K
  • Programming and Computer Science
2
Replies
58
Views
3K
  • Programming and Computer Science
2
Replies
54
Views
4K
  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
10
Views
3K
  • Programming and Computer Science
Replies
9
Views
2K
  • Programming and Computer Science
Replies
8
Views
2K
Back
Top