Hi guys
How exactly do the header files like iostream.h and stdio.h actually work?
Where is the source code for these files located?
Is it possible to read it?
6 2061 Banfa 9,065
Expert Mod 8TB
The header file just contain declarations of functions and types and constants required to call the interface they define. Typically the code for these functions exists in the C/C++ run time library which is normally automatically linked by the linker.
The library is binary, depending on your platform the source for this library may or may not be shipped with the compiler although it is shipped more and more often these days.
Also, stdio.h is a C header. C++ uses cstdio.
Also, iostream.h is the pre-ANSI C++ used prior to Sept 1998. You should be using iostream.
The header file just contain declarations of functions and types and constants required to call the interface they define. Typically the code for these functions exists in the C/C++ run time library which is normally automatically linked by the linker.
The library is binary, depending on your platform the source for this library may or may not be shipped with the compiler although it is shipped more and more often these days.
Is it possible to create our own libraries?
Sure, and in any non-trivial project, you will be using multiple third party libraries as well as making and using your own.
A library is just pre-written code than can be reused for whatever reasons. You can either ship the source code outright, or give it out as OS specific binary files, along with supporting files for compilation such as headers.
Sure, and in any non-trivial project, you will be using multiple third party libraries as well as making and using your own.
A library is just pre-written code than can be reused for whatever reasons. You can either ship the source code outright, or give it out as OS specific binary files, along with supporting files for compilation such as headers.
Could you show me how to do create a sample library, that does say add two numbers or something of the sort?
Could you show me how to do create a sample library, that does say add two numbers or something of the sort?
http://www.unet.univie.ac.at/aix/aixprggd/genprogc/create_shared_lib.htm
a little bit of google always helps
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Hattuari |
last post by:
I'm learning C++ after having spent several years in the computer industry
doing both system administration and engineering. I've written code in
Perl, Bash, Pascal, Ada, C, Mathematica (hundreds...
|
by: matthurne |
last post by:
I just started learning C++ on my own...I'm using Accelerated C++.
Something it hasn't explained and I keep wondering about is how header
files actually work. I suspect it doesn't get into it...
|
by: blueblueblue2005 |
last post by:
Hi, here is an example I copied from Deitel C++ book. but when I
compile it, always get the above compilation error, no matter how I
change the include order, please help.
here is the files:...
|
by: pooja |
last post by:
Suppose i have created a class c1 with f1()in c1.cpp
and included this c1.cpp in file1.cpp file , which is also having
main() by giving the statement #include "c1.cpp".
the same i can do by...
|
by: John Smith |
last post by:
Hi all
What does the group think of the practise of including one header file from
inside another?
I have some legacy code where this has been done, and it creates a
dependency on a module...
|
by: Al |
last post by:
I'm still trying to do this but it never worked!
In a .cpp file, I write the code, and at the beginning, I write:
#ifndef MYLIST_H
#define MYLIST_H
....to end:
#endif
What's wrong with it for...
|
by: jayceechong |
last post by:
If I write my own C compiler, can I just "take" existing standard
header files (e.g. stdio.h, stdlib.h, etc.) from an existing C compiler
and plug them in my own? I understand I have to write my...
|
by: ginnisharma1 |
last post by:
Hi All,
I am very new to C language and I got really big assignment in my
work.I am wondering if anyone can help me.........I need to port
compiler from unix to windows and compiler is written...
|
by: shruti |
last post by:
hiii all
I'm tryin to call a perl script from a C program in following 2 ways-
1.By callin system function.
But there's some problem because the system function is not able to
executeany...
|
by: weird0 |
last post by:
Hi!all. As part of the course project in the university, students
have been given task to develop a front-end for SMILE( an API written
in C++ for network modelling). Upon extracting the setup, it...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |