Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: C help please - C newbie



To everyone that has posted a reply, I will try to put your
suggestions into practice.

thank you,

Bradley



[EMAIL PROTECTED] (Bradley) wrote in message news:<[EMAIL PROTECTED]>...
> Hi, I am an Assembly language programmer of 12 years, now starting to
> code in C. I am still a C newbie and have some confusion.
> 
> I am finding that I am getting bogged down with uses of static /
> extern for functions and variables. I am also getting a bit confused
> with function prototyping and header files. I have searched the
> internet quite a bit but I am still confused.
> 
> I think that I know the following;  (Please clarify)
> 
> Static variables are local to the .c file.  Static variables also can
> stay around after the function is exited.
> A variable declared outside of Main is global and a .c file that wants
> to use it must extern it.
> 
> Static functions are visible to the .c file.  My problem here is why
> declare them static?  Isn't static assumed?
> A function can be called by other .c files if its prototype is
> External.
> 
> I have read that it is good C practice to code prototypes for each
> function.  Should I code the prototypes in a .h file associated with
> the .c file?  Where do I extern the prototype if I plan to use the
> function in multiple .c files ?
> 
> Any help / suggestions would be greatly appreciated.
> 
> thank you 
> 
> Bradley



<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.