Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > what

Reply
 
 
ARMAS
Guest
Posts: n/a
 
      02-14-2007
I'm a first year BSIT student... what should be the topic about
programming in C that should be discussed during 2nd semester

 
Reply With Quote
 
 
 
 
Malcolm McLean
Guest
Posts: n/a
 
      02-14-2007

"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.


 
Reply With Quote
 
 
 
 
santosh
Guest
Posts: n/a
 
      02-14-2007
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?

 
Reply With Quote
 
Clever Monkey
Guest
Posts: n/a
 
      02-14-2007
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.
 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      02-14-2007
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.

 
Reply With Quote
 
Malcolm McLean
Guest
Posts: n/a
 
      02-14-2007

"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.


 
Reply With Quote
 
Ben Pfaff
Guest
Posts: n/a
 
      02-14-2007
"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[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv wxyz.\
\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[i]\
);}return 0;}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57