473,396 Members | 2,057 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Origine of things !!

Ghost0s
Hi Guys i just want to know the answer of a "philosophic" Question about C and maybe other PL's the Question is : if for example there is libraries to manage network that contains functions how those functions are made "programmed" how pc starts know the ip address for example how C program makes the processor wait for a signal from the networks card
i hope you understand what im trying to say :p ??
May 13 '14 #1
8 1549
weaknessforcats
9,208 Expert Mod 8TB
There are two main types of libraries. The first is the static library and with these a copy of the library function has been injected into your executable file. Then you just call the function. You only need the ibrary when you build the program.

The second type of library is the dynamic, or shared, library. Here you have to a)load the library at run time, b) call an OS function using the name of the function in the library you want to call, c) that function returns the address of the library function, d) you typecast the address into a function pointer of the correct type, and then e) you call the library function using the typecast function pointer.

As to how the library functions themselves are coded by the OS programmers, you probably don't want to know. You are better off just learning how to use them.
May 13 '14 #2
Thnx man but i want to know how liberary functions themselves are coded :d
May 15 '14 #3
weaknessforcats
9,208 Expert Mod 8TB
They are coded the same way you would code any other function.

All you do is set your compiler project to build a library instead of an executable.
May 15 '14 #4
i think you didnt understand my question well what i want to say : how standard functions are coded for example source code of printf()
May 15 '14 #5
weaknessforcats
9,208 Expert Mod 8TB
The source code for all standard C library functions is posted on the Internet. You can download it and browse through it.

The code is different based on your operating system. Be sure to get the one that matches your OS.

You might also check your compiler installation. Some of these tools include a copy of the Standard C Library source code.
May 16 '14 #6
Can you tell me why its different for each OS + i heard that the compiler it self contain binary codes for some instructions ??
May 16 '14 #7
weaknessforcats
9,208 Expert Mod 8TB
Each OS has an internal structure that is unique. The C for that OS must make system calls for that OS. C programs are not portable. Code compiled for Windows won't compile on Linux.

It just the same as Ford cars can't use GM parts even though both cars have engines.
May 16 '14 #8
im really enjoying this conv do you ?? + what about that compiler contains codes in a binary format for some orders is that true ??

THE BIG QUESTION IS HOW KERNELs ARE WRITTEN IN C or c++ and there is a c and c++ for each o.O
May 17 '14 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Ryan Paul | last post by:
I've spent a lot of time using python, and personally, I feel like it is vastly superior when compared to languages like java, and c++, but there are still a few things that detract from its...
11
by: bearophile | last post by:
Hello, here are a four more questions (or suggestions) for the language (probably people have already discussed some of/all such things: I've seen the contracts for Python:...
383
by: John Bailo | last post by:
The war of the OSes was won a long time ago. Unix has always been, and will continue to be, the Server OS in the form of Linux. Microsoft struggled mightily to win that battle -- creating a...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
0
by: Peter R. Vermilye | last post by:
I am involved on a web application that is using a third party set of APIs for remote database access (middleware). I've been brought in because of my background in programming, thus I'm new to...
14
by: CMM | last post by:
Do the developers of Visual 2005 actuall use it??? There's lots of great things in VS2005 (mostly related to the outstanding work done on the CLR)... but in general the LITTLE THINGS totally drag...
35
by: Steven T. Hatton | last post by:
Perhaps I'm just a bit frustrated, and I will soon realize the clear truth of the matter, but right now I have some serious misgivings about the value of investing a lot of time and effort into...
75
by: Steven T. Hatton | last post by:
No, this is not a troll, and I am not promoting Java, C-flat, D, APL, Bash, Mathematica, SML, or LISP. A college teacher recently posted to this newsgroup regarding her observation that there has...
13
by: TSB | last post by:
Hi everyone, I think algorithm is very important for every computer language. But I don't know another important things. I am newbie to computer languages, so anyone can tell me what the most...
12
by: Michael Bell | last post by:
I am trying to put my learning effort into the most useful things. What do pointers do that other things can't? Michael Bell --
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
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,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.