what

Discussion in 'C Programming' started by ARMAS, Feb 14, 2007.

  1. ARMAS

    ARMAS Guest

    I'm a first year BSIT student... what should be the topic about
    programming in C that should be discussed during 2nd semester
    ARMAS, Feb 14, 2007
    #1
    1. Advertising

  2. "ARMAS" <> wrote in message
    > I'm a first year BSIT student... what should be the topic about
    > programming in C that should be discussed during 2nd semester
    >

    A few ideas are:

    opaque pointers. How to use them and the benefits / disbenefits.

    should we ever use goto?

    what makes a function reusable?

    stacks, queues and linked lists - do trees as well if you are able.
    Malcolm McLean, Feb 14, 2007
    #2
    1. Advertising

  3. ARMAS

    santosh Guest

    Malcolm McLean wrote:
    > "ARMAS" <> wrote in message
    > > I'm a first year BSIT student... what should be the topic about
    > > programming in C that should be discussed during 2nd semester
    > >

    > A few ideas are:


    <snip>

    > should we ever use goto?
    >
    > what makes a function reusable?
    >
    > stacks, queues and linked lists - do trees as well if you are able.


    Why are these specific to C?
    santosh, Feb 14, 2007
    #3
  4. santosh wrote:
    > Malcolm McLean wrote:
    >> "ARMAS" <> wrote in message
    >>> I'm a first year BSIT student... what should be the topic about
    >>> programming in C that should be discussed during 2nd semester
    >>>

    >> A few ideas are:

    >
    > <snip>
    >
    >> should we ever use goto?
    >>
    >> what makes a function reusable?
    >>
    >> stacks, queues and linked lists - do trees as well if you are able.

    >
    > Why are these specific to C?
    >

    Ah, but when teaching more advanced C it is typical to implement the
    standard sorts of structures because a.) they are good to know and often
    implemented in the language, and b.) are often written so idiomatic that
    you may as well learn it now.
    Clever Monkey, Feb 14, 2007
    #4
  5. ARMAS

    santosh Guest

    ARMAS wrote:
    > I'm a first year BSIT student... what should be the topic about
    > programming in C that should be discussed during 2nd semester


    You must be having really short semesters. Possibilities include:

    Multidimensional arrays and pointers.
    Pointers to functions
    Nested structures and unions
    Use of typedef, const, restrict, register and volatile.
    Signal generation and handling.
    Modular programming and conditional compilation.
    Error handling with errno, perror math_errno etc.
    Discussion of the C standards and their proper use.

    I'm sure there're more topics.
    santosh, Feb 14, 2007
    #5
  6. "santosh" <> wrote in message
    > Malcolm McLean wrote:
    >> "ARMAS" <> wrote in message
    >> > I'm a first year BSIT student... what should be the topic about
    >> > programming in C that should be discussed during 2nd semester
    >> >

    >> A few ideas are:

    >
    > <snip>
    >
    >> should we ever use goto?
    >>
    >> what makes a function reusable?
    >>
    >> stacks, queues and linked lists - do trees as well if you are able.

    >
    > Why are these specific to C?
    >

    goto is a C keyword. Other languages sometimes have equivalents, sometimes
    even called "goto". If every C construct that had some equivalent in another
    lanauge was excluded from discussion, it would be quite hard to think up
    topics.

    "What makes a function reusable?" could be interpreted either in a very
    non-C specific fashion or in a way very narrowly focused on the C language.
    Not all other languages provide functions; in most that do the reusability
    of a function is determined by rather different factors than affect the
    typical C function. Fortran 77 functions, for example, are frequently
    non-reusable because of the lack of dynamic memory for workspace.

    Stacks, queues, linked lists and teees are not specific to C, but in
    practise C is a language in which these structures are likely to be
    implemented. Becasue of a weakness or stength of C syntax, whichever way you
    look at it, whilst it is possible to build an abstract linked list in C, it
    is actually easier in practical programs to code the links from scratch.
    Malcolm McLean, Feb 14, 2007
    #6
  7. ARMAS

    Ben Pfaff Guest

    "Malcolm McLean" <> writes:

    > Becasue of a weakness or stength of C syntax, whichever way you
    > look at it, whilst it is possible to build an abstract linked
    > list in C, it is actually easier in practical programs to code
    > the links from scratch.


    I doubt this. Perhaps you've never used a decent implementation
    of an abstract linked list in C, but my experience is that
    they're easier to use and (above all) less error-prone to use
    than to open-code a linked list every time you need one. Check
    out, for example, the linked list package used in the Linux
    kernel.
    --
    int main(void){char p[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.\
    \n",*q="kl BIcNBFr.NKEzjwCIxNJC";int i=sizeof p/2;char *strchr();int putchar(\
    );while(*q){i+=strchr(p,*q++)-p;if(i>=(int)sizeof p)i-=sizeof p-1;putchar(p\
    );}return 0;}
    Ben Pfaff, Feb 14, 2007
    #7
    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.

Share This Page