what

A

ARMAS

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

Malcolm McLean

ARMAS said:
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.
 
C

Clever Monkey

santosh said:
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.
 
S

santosh

ARMAS said:
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.
 
M

Malcolm McLean

santosh said:
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.
 
B

Ben Pfaff

Malcolm McLean said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top