headerfiles how define program project wide structurers? and how header file wide (i mean applies only file where they defined) structures? i know how struces are defined but my sources dont ansver this.
headerfiles how define program project wide structurers? and how header file wide (i mean applies only file where they defined) structures? i know how struces are defined but my sources dont ansver this.
Not sure what you are talking about. Are you referring to how the Windows API has "wide" and "narrow" interfaces and structures?
gg
project is program what i develop.first way all header file defined structures,and variables i want used in whole program. and second way header file has own structures which dont show elsewhere. Actually i think now heared file structures,and variables show all to main code because os related header files work this way.
ps. no i dont develop Windows actually much better multitasking (before has multitasking before windows) graphical operating system which latest version is 4.1 and its runs PowerPC based computers today.
Well, definitions go in header files, and declarations go in your translation units (.c files).
Perhaps this will help:
What's the difference between declaring and defining in C and C++ - Cprogramming.com
https://www.google.com/search?q=C%20header%20tutorial
gg
Whicj means i must declare in main code all functions what headers have? now i dont understand why os functions,and ansi c functions works without this.
ps. before windows in my comment means Windows which mean Operating system not windows what all modern? graphical operating systems uses.
>> now i dont understand why os functions,and ansi c functions works without this.
Either the compiler automatically links in the appropriate libraries, or the needed libraries are specified on the command line.
You can achieve the same thing generically using object files, static libraries, or dynamic libraries.
src.h
src.c -> src.obj
main.c includes src.h and links with src.obj
gg
It is actually the opposite, i.e., extern variable and function declarations (that are not also definitions) typically go in header files whereas their definitions go in the source files. A struct definition would also go in a header file; the C standard regards that as a declaration of a structure type that defines the structure content. A translation unit is actually the source file + the included (typically header) files after preprocessing.Originally Posted by Codeplug
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
What's worse is that I glanced over Alex's article first to ensure I didn't get em reversed.
I was gifted dyslexia with to keep you own your toes
gg <-- reversed
You might try this font; and give feedback on whether it helps.
Christian Boer’s Dyslexie is a typeface for dyslexics.
Edit: I just read about it on a ebook forum I read.
Tim S.
"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson
Whether a structure is available "project wide" is up to you. If the structure is defined in a header file, then its definition is available in any other file which includes that header file. If you want to absolutely ensure that a structure can't be used outside of one specific module, then you can declare it in the .c or .cpp file where it will be used.
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}