Jump to content
  • Advertisement
Sign in to follow this  
Nanook

stream width and function files

This topic is 4375 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

To questions: 1. what does "width of a stream" mean? 2. in my book it declears the functions in a header file and it includes it in the main source file.. thats ok.. but it also tells me to put the definitions of the function in another source file.. how does the compiler know that this source files are beeing used in the main source file?

Share this post


Link to post
Share on other sites
Advertisement
1 - I'm not sure what the width of a stream is without context, but if I were to guess, then I would say it is the size of the character type (you generally have two typedefs for char and wchar_t in the standard stream types, e.g. ifstream, wifstream).

2 - It doesn't. That's the point. The compiler does not need to know where the functions or defined or how they are implemented. That is the job of the linker. The linker links together all of the object files that were generated by the compiler. The compiler just need to know that these functions exist. For more information, see Organizing Code Files in C and C++.


jfl.

Share this post


Link to post
Share on other sites
1. sorry, should have specified more.. its the member of a stream.. but what does it do? like s.width(n)

2. ok.. so aslong as the source file with the function definition's is compiled once the compiler will remember them whenever I want to use them? aslong as I include the head file in the programs I'm making?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!