Wanting to Learn

Discussion in 'C Programming' started by Tim Apple, Feb 4, 2004.

  1. Tim Apple

    Tim Apple Guest

    Hello All,

    I would like to learn C, I have 0 programming experience. If anyone has
    links to good tutorials It would be appreciated, especially stuff that can
    be downloaded. I am in the military and will be spending the next year in
    Iraq. I will have my laptop with me and will use my free time to learn,
    but I will have no net access. So whatever I can get on my hard drive to
    bring with would be appreciated. Thanks

    Sgt Tim Apple
    US Army
    Tim Apple, Feb 4, 2004
    #1
    1. Advertising

  2. Tim Apple

    Richard Bos Guest

    Tim Apple <> wrote:

    > I would like to learn C, I have 0 programming experience.


    Warning: C can be full of traps for the absolute beginner, especially
    without a proper teacher. It _is_ possible to learn to be a good
    programmer starting with C, but trying to do so on your own is asking
    for trouble, especially from a web tutorial - most aren't very good.

    It's wiser, IMO, to learn to be a good programmer first, and then learn
    C. C assumes that the programmer knows what he's doing. Learning to
    program is easier using a language that assumes you don't know what
    you're doing. I personally suggest Pascal, but other people will
    recommend other languages, most of whom I haven't tried, so can't judge.

    Richard
    Richard Bos, Feb 4, 2004
    #2
    1. Advertising

  3. * Thus spoke Tim Apple <>:

    Hallo,

    > I would like to learn C, I have 0 programming experience. If anyone has
    > links to good tutorials It would be appreciated, especially stuff that can
    > be downloaded.


    o <http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html#q6.2>
    o <http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html#q7.1>


    Wolfgang.
    --
    "I can remember the exact instant when I realized that a large part of my life
    from then on was going to be spent in finding mistakes in my own programs."
    -- Maurice Wilkes
    Wolfgang Kaufmann, Feb 4, 2004
    #3
  4. Tim Apple

    Leor Zolman Guest

    On Wed, 04 Feb 2004 14:56:44 GMT, Tim Apple <>
    wrote:

    >Hello All,
    >
    >I would like to learn C, I have 0 programming experience. If anyone has
    >links to good tutorials It would be appreciated, especially stuff that can
    >be downloaded. I am in the military and will be spending the next year in
    >Iraq. I will have my laptop with me and will use my free time to learn,
    >but I will have no net access. So whatever I can get on my hard drive to
    >bring with would be appreciated. Thanks
    >
    >Sgt Tim Apple
    >US Army


    It's true that C and C++ aren't the best "first" programming
    languages; you may be told by the compiler that you've done something
    wrong, but you'll still have a lot of trouble knowing how to fix it.
    (That's still true for me right now, actually, for template messages
    in C++...)

    If you do decide to tackle C, a couple of suggestions:

    1), 2), 3), and 4) Find someone who already knows it that will let you
    ask him/her questions. That's IMO by far the most important resource
    you'll ever have.

    5) Get a copy of K&R 2nd ed. , and then either "The C Answer Book"
    (hard copy) or you can grab this site off the web (using, say,
    TelePort Pro):
    http://users.powernet.co.uk/eton/kandr2/

    Do all the exercises yourself, then compare your solutions. If you
    make it through all that, you'll know C pretty well ;-)
    -leor


    Leor Zolman
    BD Software

    www.bdsoft.com -- On-Site Training in C/C++, Java, Perl & Unix
    C++ users: Download BD Software's free STL Error Message
    Decryptor at www.bdsoft.com/tools/stlfilt.html
    Leor Zolman, Feb 4, 2004
    #4
  5. Tim Apple

    Tim Apple Guest

    Some of you are saying c is not the best language to start with pascal was
    a recomendation, any others?

    Sgt Tim Apple







    On Wed, 04 Feb 2004 14:56:44 +0000, Tim Apple wrote:

    > Hello All,
    >
    > I would like to learn C, I have 0 programming experience. If anyone has
    > links to good tutorials It would be appreciated, especially stuff that can
    > be downloaded. I am in the military and will be spending the next year in
    > Iraq. I will have my laptop with me and will use my free time to learn,
    > but I will have no net access. So whatever I can get on my hard drive to
    > bring with would be appreciated. Thanks
    >
    > Sgt Tim Apple
    > US Army
    Tim Apple, Feb 4, 2004
    #5
  6. Tim Apple

    gabriel Guest

    Tim Apple wrote:

    > Some of you are saying c is not the best language to start with pascal
    > was a recomendation, any others?


    Well, what do you want to do? I know a lot of military people who are
    trying to figure out what to do afterwards, and they choose to get into
    programming. Is this you?

    There are a lot of things to consider, specially the type of programming
    that you want to get into. If you would like to tinker with "system" stuff
    like operating systems, very scientific algorithms, or you would like to
    squeeze out every possible bit of performance out of the processor (and who
    cares if it takes a year to write), then C is a great place to start.

    If you would like to learn computer science in general, then I would start
    out with C#, Java, or Delphi, but only because, as others said, starting in
    C without a mentor nearby is suicide.

    If you want to write GUI programs with the nice screens and friendly
    interfaces, database access, and rapid development, then you would do
    better to go to the anti-Christ (at least in this group) sort of
    technologies (Microsoft Visual Basic, or .NET), or a more sensible choice
    which is Delphi (Borland's Object-Oriented Pascal). The focus in these
    kinds of languages is to let you put something out the door quicker,
    looking nicer, and you did not spend a long time producing it. Also, when
    writing with these kinds of languages and compilers, you concentrate more
    on _what_ you are solving rather than _how_ you are solving it.

    --
    gabriel
    gabriel, Feb 4, 2004
    #6
  7. Tim Apple wrote:
    > Some of you are saying c is not the best language to start with pascal was
    > a recomendation, any others?
    >
    > Sgt Tim Apple
    >


    #include <evangelism/python.h>

    Python is a simple but powerful (in term of what you can do, not of
    execution speed !-) language that may be a good choice for absolute
    beginners, since
    - the syntax is clear and readable
    - the language supports many paradigms (procedural - as C and Pascal-,
    object - as C++ and Java and... -, functional - as Lisp, ML etc)
    - it comes with an interpreter and a shell, so you can test code in
    'real time'
    - there are some Python tutorials for absolute beginners.

    http://www.python.org

    Well, it's quite a good replacement for grand dad's basic, and you can
    also use it to write real, non trivial, working apps.

    Now it won't learn you the low-level details of memory management and
    the like...

    My 2 cents
    Bruno
    Bruno Desthuilliers, Feb 4, 2004
    #7
  8. Tim Apple

    Sidney Cadot Guest

    Tim Apple wrote:

    > Some of you are saying c is not the best language to start with pascal was
    > a recomendation, any others?


    Python was recommended as well. Perhaps the ideal learning path would
    consist of a couple of months Python (which is an interpreted language
    without strongly typed variables), followed by a transition to the much
    stricter Pascal. This would give you a great deal of insight into the
    relative strengths and weeknesses of both types of languages.

    After mastering Pascal you will be ready to take on C. It has many more
    'degrees of freedom', i.e. it is (somewhat) more powerful, but it is
    also much harder to use properly.

    For Pascal, I'd recommend you get your hands on Turbo Pascal 7, which is
    very old, but it was /way/ ahead of its time. As a didactic device, I
    think the environment (with the integrated debugger) cannot be beaten.

    Turbo Pascal is a superset of Pascal by the way, meaning that you get
    many (sensible!) extensions to plain (ISO) Pascal.


    Have a good mission and a safe return.


    Best regards,

    Sidney
    Sidney Cadot, Feb 4, 2004
    #8
  9. Tim Apple

    Morris Dovey Guest

    Tim Apple wrote:

    > I would like to learn C, I have 0 programming experience.


    Tim...

    Then go for it! Everyone has to start somewhere. You'll need
    access to a computer with a C compiler and some reading material.
    Start by writing tiny, simple programs and work your way up to
    larger, more complex, programs.

    Feel free to make mistakes - you'll probably learn more from
    those than from any other single source.

    You've already found comp.lang.c - feel welcome to come here for
    help with any C difficulties you might have.

    My sig has a link to a page of links for beginners. Take time to
    read about asking smart questions and the comp.lang.c welcome and
    FAQ pages.

    There's info there that'll help you download a free C compiler if
    you don't have one available.

    --
    Morris Dovey
    West Des Moines, Iowa USA
    C links at http://www.iedu.com/c
    Read my lips: The apple doesn't fall far from the tree.
    Morris Dovey, Feb 4, 2004
    #9
  10. Tim Apple

    Ashish Guest

    "Tim Apple" <> wrote in message
    news:p...
    > Hello All,
    >
    > I would like to learn C, I have 0 programming experience. If anyone has
    > links to good tutorials It would be appreciated, especially stuff that can
    > be downloaded. I am in the military and will be spending the next year in
    > Iraq. I will have my laptop with me and will use my free time to learn,
    > but I will have no net access. So whatever I can get on my hard drive to
    > bring with would be appreciated. Thanks
    >
    > Sgt Tim Apple
    > US Army


    Tim, get a good C book with lots of examples, and a free (or non-free) C
    compiler.
    One book which I used many years ago, when I started learning C, was
    'Mastering Turbo C' by Tenanbaum. It has lots of good examples. Others may
    have better advices for books, though.

    HTH
    -Ashish
    Ashish, Feb 4, 2004
    #10
  11. Tim Apple

    CBFalconer Guest

    Sidney Cadot wrote:
    > Tim Apple wrote:
    >
    > > Some of you are saying c is not the best language to start with pascal was
    > > a recomendation, any others?

    >
    > Python was recommended as well. Perhaps the ideal learning path would
    > consist of a couple of months Python (which is an interpreted language
    > without strongly typed variables), followed by a transition to the much
    > stricter Pascal. This would give you a great deal of insight into the
    > relative strengths and weeknesses of both types of languages.
    >
    > After mastering Pascal you will be ready to take on C. It has many more
    > 'degrees of freedom', i.e. it is (somewhat) more powerful, but it is
    > also much harder to use properly.
    >
    > For Pascal, I'd recommend you get your hands on Turbo Pascal 7, which is
    > very old, but it was /way/ ahead of its time. As a didactic device, I
    > think the environment (with the integrated debugger) cannot be beaten.
    >
    > Turbo Pascal is a superset of Pascal by the way, meaning that you get
    > many (sensible!) extensions to plain (ISO) Pascal.


    In the interests of accuracy, TP is not a superset, it is a
    subset, with many extensions. It has very serious omissions of
    standard Pascal capabilities. The extensions introduce many
    insecurities, but you don't have to use them. Unfortunately it
    won't tell you what IS standard and what is extension.

    --
    Chuck F () ()
    Available for consulting/temporary embedded and systems.
    <http://cbfalconer.home.att.net> USE worldnet address!
    CBFalconer, Feb 5, 2004
    #11
  12. Re:[OT] Wanting to Learn

    Sidney Cadot wrote:
    > Tim Apple wrote:
    >
    >> Some of you are saying c is not the best language to start with pascal
    >> was
    >> a recomendation, any others?

    >
    >
    > Python was recommended as well. Perhaps the ideal learning path would
    > consist of a couple of months Python (which is an interpreted language
    > without strongly typed variables),


    <ot topic='python'>
    Er... I would not start the Standard Holy War n°2 (tm) [1], but just a
    correction : Python *is* strongly typed [2] - but dynamically. Which
    means that the type is bound to the object, not to the id the object is
    bound to.

    [1] which is "dynamic vs static typing"
    [2] You just can't add a string, an integer and a list together, this
    would raise an exception.

    </ot>

    (snip the rest)

    Bruno
    Bruno Desthuilliers, Feb 5, 2004
    #12
  13. Tim Apple

    Sidney Cadot Guest

    Re: [OT] Wanting to Learn

    Bruno Desthuilliers wrote:
    > Sidney Cadot wrote:
    >
    >> Tim Apple wrote:
    >>
    >>> Some of you are saying c is not the best language to start with
    >>> pascal was
    >>> a recomendation, any others?

    >>
    >>
    >>
    >> Python was recommended as well. Perhaps the ideal learning path would
    >> consist of a couple of months Python (which is an interpreted language
    >> without strongly typed variables),

    >
    >
    > <ot topic='python'>
    > Er... I would not start the Standard Holy War n°2 (tm) [1], but just a
    > correction : Python *is* strongly typed [2] - but dynamically. Which
    > means that the type is bound to the object, not to the id the object is
    > bound to.
    >
    > [1] which is "dynamic vs static typing"
    > [2] You just can't add a string, an integer and a list together, this
    > would raise an exception.
    >
    > </ot>


    Your terminology is, indeed, less prone to confusion. However, it is
    debatable what "strongly typed language" really means; personally, I
    take it to be equivalent to what you call a "statically typed" language.

    If someone else has a different idea, I'd love to hear it; I'd also like
    to see examples of non-strongly-typed languages, for an alternative
    definition.

    Best regards,

    Sidney
    Sidney Cadot, Feb 5, 2004
    #13
  14. Re: [OT] Wanting to Learn

    Sidney Cadot wrote:
    > Bruno Desthuilliers wrote:
    >
    >> Sidney Cadot wrote:
    >>

    (snip)
    >>> Python was recommended as well. Perhaps the ideal learning path would
    >>> consist of a couple of months Python (which is an interpreted
    >>> language without strongly typed variables),

    >>
    >> <ot topic='python'>
    >> Er... I would not start the Standard Holy War n°2 (tm) [1], but just a
    >> correction : Python *is* strongly typed [2] - but dynamically. Which
    >> means that the type is bound to the object, not to the id the object
    >> is bound to.
    >>
    >> [1] which is "dynamic vs static typing"
    >> [2] You just can't add a string, an integer and a list together, this
    >> would raise an exception.
    >>
    >> </ot>

    >
    > Your terminology is, indeed, less prone to confusion. However, it is
    > debatable what "strongly typed language" really means;


    Indeed. The meaning of a whole lot of things is debatable.
    What about : "a strongly typed language is a language that won't let you
    add an integer and a string" ?-)

    > personally, I
    > take it to be equivalent to what you call a "statically typed" language.


    And you're wrong - at least with the above definition.

    > If someone else has a different idea, I'd love to hear it;


    You did !-)

    > I'd also like
    > to see examples of non-strongly-typed languages, for an alternative
    > definition.


    <no-holy-war-please>

    You've got one right here : the C programming language.

    [laotseu@localhost fclc]$ cat add.c

    int main(void)
    {
    int z;
    char *y;
    int a = 10;
    char *b = "30";
    a + b;
    z = a + b;
    y = a + b;
    return 0;
    }
    [laotseu@localhost fclc]$ gcc -Wall -ansi -pedantic add.c
    add.c: In function `main':
    add.c:9: warning: assignment makes integer from pointer without a cast
    add.c:8: warning: statement with no effect
    [laotseu@localhost fclc]$


    Well... As you can see, adding an integer and a char pointeur is not a
    problem for gcc.


    Now in python :

    [laotseu@localhost fclc]$ python
    Python 2.3.2 (#1, Oct 27 2003, 01:23:54)
    >>> a = 10
    >>> b = "30"
    >>> a + b

    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    TypeError: unsupported operand type(s) for +: 'int' and 'str'
    >>>


    Now here you just *can't* add an integer and a string.

    </no-holy-war-please>

    Ok, I know, I gave a *really* debatable definition of "strongly typed",
    and one that did fit my needs. Call me a cheater if you want (time to
    put my bullet-proof jacket on, I think).

    Bruno
    Bruno Desthuilliers, Feb 5, 2004
    #14
  15. Re: [OT] Wanting to Learn

    In article <4022ce13$0$11239$> Bruno Desthuilliers <> writes:
    > Sidney Cadot wrote:

    ....
    > > Your terminology is, indeed, less prone to confusion. However, it is
    > > debatable what "strongly typed language" really means;

    >
    > Indeed. The meaning of a whole lot of things is debatable.
    > What about : "a strongly typed language is a language that won't let you
    > add an integer and a string" ?-)


    Would make Algol 68 a weakly-typed language if you add the following
    declaration:
    'op'('int','string') + = (('int' i, 'string' s): i);
    (Darn, I am forgetting the syntax, the above is probably not entirely
    correct.)

    But have a look at <http://c2.com/cgi/wiki?StronglyTyped>, I personally
    prefer definition 8. Python does not satisfy quite a few of those 8
    definitions.
    --
    dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
    home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
    Dik T. Winter, Feb 6, 2004
    #15
  16. Tim Apple

    Jason Guest

    Tim Apple wrote:
    > Hello All,
    >
    > I would like to learn C, I have 0 programming experience. If anyone has
    > links to good tutorials It would be appreciated, especially stuff that can
    > be downloaded. I am in the military and will be spending the next year in
    > Iraq. I will have my laptop with me and will use my free time to learn,
    > but I will have no net access. So whatever I can get on my hard drive to
    > bring with would be appreciated. Thanks
    >
    > Sgt Tim Apple
    > US Army


    Sgt. Apple,

    In much appreciation of your willingness to serve in the armed forces to
    protect the citizens (myself a citizen of this great nation) of this
    nation, I am willing to send you a book from my personal library as a
    small token of my appreciation.

    The book is titled C How to Program 2nd edition and is written by
    H.M.Deitel and P.J. Deitel. It is a paperback text with an ISBN number
    of 0-13-226119-7 in case you want to look at it on amazon.com or another
    book seller online.

    This is the text I used when I took my first programming class and I
    thought it was a pretty good book.

    If you are interested, please write me at .

    Thank you, Best Wishes, and God Speed.

    Sincerely,

    Jason Smith
    Jason, Feb 6, 2004
    #16
  17. Tim Apple

    Sidney Cadot Guest

    Re: [OT] Wanting to Learn

    Dik T. Winter wrote:

    > In article <4022ce13$0$11239$> Bruno Desthuilliers <> writes:
    > > Sidney Cadot wrote:

    > ...
    > > > Your terminology is, indeed, less prone to confusion. However, it is
    > > > debatable what "strongly typed language" really means;

    > >
    > > Indeed. The meaning of a whole lot of things is debatable.
    > > What about : "a strongly typed language is a language that won't let you
    > > add an integer and a string" ?-)

    >
    > Would make Algol 68 a weakly-typed language if you add the following
    > declaration:
    > 'op'('int','string') + = (('int' i, 'string' s): i);
    > (Darn, I am forgetting the syntax, the above is probably not entirely
    > correct.)
    >
    > But have a look at <http://c2.com/cgi/wiki?StronglyTyped>, I personally
    > prefer definition 8. Python does not satisfy quite a few of those 8
    > definitions.


    Nice page. It is strange to see that a term that is so often used seems
    to lack a proper definition.

    Anyway, an excuse for me using "strongly typed", originally, is that I
    used it to refer to "variables", not the "language".

    Best regards,

    Sidney
    Sidney Cadot, Feb 6, 2004
    #17
  18. Re: [OT] Wanting to Learn

    Dik T. Winter wrote:
    > But have a look at <http://c2.com/cgi/wiki?StronglyTyped>, I personally
    > prefer definition 8. Python does not satisfy quite a few of those 8
    > definitions.


    Neither does C! C fails to satisfy at least the following:

    4. A language is strongly typed if conversions between different
    types are forbidden. If such conversions are allowed, it is
    weakly typed.

    5. A language is strongly typed if conversions between different
    types must be indicated explicitly. If implicit conversions are
    performed, it is weakly typed.

    6. A language is strongly typed if there is no language-level way
    to disable or evade the type system. If there are casts or
    other type-evasive mechanisms, it is weakly typed.

    8. A language is strongly typed if the type of its data objects is
    fixed and does not vary over the lifetime of the object. If the
    type of a datum can change, the language is weakly typed.

    Is there /any/ language that forbids "conversions between different
    types" unconditionally?

    Jeremy.
    Jeremy Yallop, Feb 6, 2004
    #18
  19. Tim Apple

    Richard Bos Guest

    Re: [OT] Wanting to Learn

    Jeremy Yallop <> wrote:

    > Dik T. Winter wrote:
    > > But have a look at <http://c2.com/cgi/wiki?StronglyTyped>, I personally
    > > prefer definition 8. Python does not satisfy quite a few of those 8
    > > definitions.

    >
    > Neither does C! C fails to satisfy at least the following:
    >
    > 4. A language is strongly typed if conversions between different
    > types are forbidden. If such conversions are allowed, it is
    > weakly typed.
    >
    > 5. A language is strongly typed if conversions between different
    > types must be indicated explicitly. If implicit conversions are
    > performed, it is weakly typed.


    _Every_ language must, inevitably, fail at least one of the above -
    they're mutually exclusive. I think you're supposed to pick the one you
    prefer, not take them all at once.

    Richard
    Richard Bos, Feb 6, 2004
    #19
  20. Re: [OT] Wanting to Learn

    In article <> Jeremy Yallop <> writes:
    > Dik T. Winter wrote:
    > > But have a look at <http://c2.com/cgi/wiki?StronglyTyped>, I personally
    > > prefer definition 8. Python does not satisfy quite a few of those 8
    > > definitions.

    >
    > Neither does C! C fails to satisfy at least the following:

    ....
    > 8. A language is strongly typed if the type of its data objects is
    > fixed and does not vary over the lifetime of the object. If the
    > type of a datum can change, the language is weakly typed.


    In what way does C fail here?
    --
    dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
    home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
    Dik T. Winter, Feb 6, 2004
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lucia
    Replies:
    5
    Views:
    320
    Roedy Green
    Nov 3, 2003
  2. Zeljko Vrba
    Replies:
    13
    Views:
    601
  3. arsl89

    wanting

    arsl89, Jul 18, 2006, in forum: Python
    Replies:
    7
    Views:
    459
    Patrick Bothe
    Jul 18, 2006
  4. jt
    Replies:
    3
    Views:
    924
    Keith Thompson
    May 23, 2005
  5. Replies:
    0
    Views:
    322
Loading...

Share This Page