Welcome, Guest. Please login or register.

Author Topic: Beginners 'C' programing group  (Read 13085 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline iamaboringperson

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 5744
    • Show all replies
Re: Beginners 'C' programing group
« Reply #14 from previous page: February 15, 2004, 04:37:35 AM »
Re: Pointers in C


People do find pointers tricky, and I guess that could be due to the fact that people don't really understand what they are.


Not that I reccomend going out and learning assembler just to under stand them, but I knew assembler before I started learning C, so I knew about addressing already.

Some of the code looked a little funny (ampersands and asterisks infront of variable names), and when I realised that a 'pointer' was actually just an address of a particular variable or structure, it became so much easier.


I think it's important to learn how functions are entered and exited. And to learn about how the stack works, that may solve some peoples problematic programming - like what fluff 'pointed' out.


One problem I had when I started learning C, was understanding how functions worked. I could define them etc.  however I treated function calls like 'gosub' or 'goto' in basic.

What I would sometimes do, is if I wanted to 'goto' the top of the function, I would just thisveryfunc() there!! Of course a program doing that will easily run out of stack space after a while! (yeah.. recursion...)

Recursion I think is a fairly advanced subject, the only use for it that comes into mind at the moment (although there are many more) is traversing binary trees etc.


People who are used to Basic and Assembler need to get used to the idea of local variables, too :)

 

Offline iamaboringperson

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 5744
    • Show all replies
Re: Beginners 'C' programing group
« Reply #15 on: February 15, 2004, 12:44:13 PM »
Quote
Since I studied chemisrty, I learned 680x0/PPC asm, C, C++ and Java entirely in my own time. I also started with a knowledge of BASIC and can assure anybody that moving to C from such a background is far from impossible.
Which remindes me that in one course I took, we had to program in C for a couple of the digital electronics modules. (Interfacing with hardware we assembled)

C is not just a language that 'programmers' who are employed to only program use. It's probably used in many other professions also. I could imagine that electronics engineers these days probably couldn't get very far without a little programming experience.

And C is probably the best language for scientific use.
 

Offline iamaboringperson

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 5744
    • Show all replies
Re: Beginners 'C' programing group
« Reply #16 on: February 15, 2004, 09:34:33 PM »
Quote
The C-syntax was copied because it is what most
programmers are used to already.
Oh dear..

No, it's copied because that's what programmers prefer

Quote
Syntactically its a piece of ***.
And lets not talk about C++.
Both are great languages

What language do you prefer?

Don't tell me Pascall.... or BASIC.... or *eeck* COBOL...

Excluding the look-a-like clones, C is the most structured and best designed programming language out there.