Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tutorial on C pointers and arrays from a Java standpoint

I'm currently a freshman in college, majoring in CS. I'm just about done with my "Intro to Computer Programming" class. I like it and feel like I'm learning a good bit.

A couple days ago, I read Joel's The Peril Of Java Schools. "A Linked List?" I thought, "those aren't even hard. We've done a bunch of those already in the class I'm in right now." Which is correct, because in Java, they're not that hard. But anyways, I tried to give writing one in C a try.

And it is SO HARD!

Joel was right, I think ... Java deals with so many little itsy-bitsy things for you that it's really not that hard. But I'm determined to overcome my school's Java-tude and learn how to write this dang linked list in C.

So I guess, instead of trying to ask lots and lots of little tiny questions, I am asking, does anyone know of a good (& free) online tutorial for learning C? Specifically, learning how to deal with pointers, and all those symbols (&, *, **, [] and how they work together) I'd like to think I'm already pretty proficient in Java, so I don't need the tutorials on how to write a "Hello, World!" program. But then I'm definitely not ready to get into any super-advanced C or C++ anything, because all I know is Java.

Any help appreciated!

like image 600
Jan Avatar asked Dec 04 '10 20:12

Jan


2 Answers

Some tutorials:

  • Moving from Java to C++
  • Learning C from Java
  • C for Java Programmers course (course notes and slides)

Some good pointer answers which might help:

  • What are the barriers to understanding pointers and what can be done to overcome them?
  • What is a void pointer and what is a null pointer?
  • Arrays, what's the point?
  • What do people find difficult about C pointers?
  • Switching from Java to C++ - what's the easy way?
  • Is Java pass by reference?

The first is a damn good read about pointers and their pitfalls, if you can get past the Pascal syntax.

like image 117
Chris Dennett Avatar answered Nov 20 '22 02:11

Chris Dennett


Check and see if your curriculum requires Systems Programming. Its usually a 300-level sophomore course, and I'm enrolled for that next semester. It is heavily involved working with C+GCC in Unix.

Check your CS dept library, if one exists. I picked up a copy of K&R to work on through winter break.

like image 3
Jason Avatar answered Nov 20 '22 03:11

Jason