Standard and Programmer-Defined
Programming languages provide a set of standard functions as well as allow programmers to define their own functions. For example, the C and C++ programming languages are built entirely of functions and always contain a "main" function.
The Application Programming Interface (API)
Functions in one program can also be called for by other programs and shared. For example, operating systems can contain more than a thousand functions to display data, print, read and write disks and perform a myriad of tasks. Programmers write their applications to interact with the OS using these functions. This list of functions is called the "application programming interface" (API).
Function Calls
Functions are activated by placing a "function call" statement in the program. The function call often includes values (parameters) that are passed to the function. When called, the function performs the operation and returns control to the instruction following the call. The function may return a value or not. Writing a program in a language such as C/C++ involves calling language functions, one's own functions and operating system functions (APIs). There is a whole lot of function calling. See function prototype, API and interface.
A Function Call Example: Open and Read
The example below shows two very simplified API functions to open and read a file.
The OPEN function is called to read the file "budget.txt," and the function returns a value in the variable HANDLE. If the file was opened successfully, HANDLE might contain a positive number, but if not, a negative one. The value in HANDLE is then passed to the READ function to read so many bytes (LENGTH) of the file into a memory area called INPUTBUFFER. The OPEN function returns the number of bytes read in the SIZE variable.
handle = open("budget.txt");
size = read(handle, InputBuffer, length);
![]() | Reproduced with permission from Computer Desktop Encyclopedia. Copyright (c) 1981-2008 The Computer Language Company Inc. All rights reserved. |
Additional Resources
- Making the giant health database work for you
- It's these medical records experts whose function has been lost in the translation from paper to magnetic ink, Damianakis concluded, and unless that is recovered digital systems will never work as well as paper. by Dana Blankenhorn
- Blog posts 2008-10-10
- easyStock MetaStock (exe)
- MetaStock data converter, super easy to use. Just specify the input and output data folder and click convert - done. All settings can be saved and are loaded automatically on start up. Other handy functions such as 'convert ticker function', 'convert up to date function', 'ticker picker', and more. This...
- Software downloads 2008-10-09
- 123 Video Downloader (exe)
- 123 Video Downloader is an easy videos downloader. You can use it to download directly from YouTube, metacafe, and break.com. Simply paste video URL, then click mouse. The software will download the video as FLV file instantly. You don't have to use any other download manager, 123 Video Downloader uses...
- Software downloads 2008-10-09
- JBL On Stage IIIP
- Though they are portable devices, the iPod and the iPhone can make a wonderful source for headphone-free music when connected to a speaker. If you have a player full of great music and personalized playlists, you might as well play it out loud every once in a while. Unfortunately, several...
- Product reviews 2008-10-08
- HP Compaq CQ50-215NR
- Note: This review is part of our Holiday 2008 Retail Laptop Roundup, covering specific new configurations of popular laptops that can be found in retail stores.With a glossy lid and relatively trim profile, the Compaq Presario CQ50-215nr looks more expensive than its $549 price tag. Unfortunately, looks aren't everything: the...
- Product reviews 2008-10-08
- Accent Access Password Recovery (exe)
- If you lose or forget the password for MS Access, don't despair - you can use Accent Access Password Recovery to recover the password faster than otherwise. The Accent Access Password Recovery can recover the passwords in MS Access 95/97/2000. You simply open your password protected file and this program...
- Software downloads 2008-10-08
- MedMemory's Patient Health Record (exe)
- This is a digital personal patient health record. It helps organize and store Patient Health Records using specially designed software which can be run from a USB drive. Show love buy one for grandma, or a loved one. Understand...the ongoings of your doctors and conditions. Organize...access everything in two clicks....
- Software downloads 2008-10-08
- BI Crystal Ball – Next Gen BI May Be Closer Than You Think
- Most modern large enterprise Business Intelligence BI tools are very robust and feature rich these days. Up until a few years ago BI users could blame vendors for most of their BI ills. This is getting harder and harder to do. Many of the BI tools, especially the ones reviewed...
- Blog posts 2008-10-07
- And the calculator saga continues
- And the calculator saga continuesre: calculatorsThis is sadly true. When I was getting my MS in math, I had a TA ship and was often assigned to freshman calculus. There were questions like "compute the first derivative", "find the min/max points", "find the inflection points" etc. of a given function...
- Discussion threads 2008-10-05
- Valleywag, Consumerist sites announce layoffs
- A source close to Gawker Media informed me a moment ago that popular sites Consumerist, Valleywag and NSFW Fleshbot will may be shuttered will lose most of their editorial talent. "Nineteen jobs will be cut," my source says, with a formal announcement from Gawker Media coming later...
- Blog posts 2008-10-03
- My growing hatred for calculators
- Is it just me, or are graphing calculators overly complicated? I've never been a big fan of calculators; I think they're a crutch on which most kids in the States rely far too heavily. However, when used correctly, they can certainly be a fine tool for automating tedious...
- Blog posts 2008-10-03
- Apple releases iTunes 8.0.1; Apple TV 2.2
- Apple releases iTunes 8.0.1; Apple TV 2.2I've lost count how many updates and how much bandwidth this yearI am getting really sick of having to update iTunes every other week.Am I just the only one? And it's not like I have a convenient alternative either.I have a Zune as well...
- Discussion threads 2008-10-03
- Student Technology Day: event photo's
- I spent most of the day taking snaps; concealed from within my lap a camera without the flash function. I say that, because we weren't technically allowed to take photos and was told off by someone half way through. Nevertheless, there are some interesting photos here; some of which show...
- Blog posts 2008-10-03
- Agree AVI WMV MPEG ASF MOV to Zune Converter (exe)
- Agree AVI WMV MPEG ASF MOV to Zune Converter is video converter software. It can convert almost any video format to play on Microsoft Zune video player, e.g. AVI, WMV, MPEG, MP4, ASF, VOB, 3GP, iPhone, MOV to Zune movie / Zune video format. You can set encoding parameters including...
- Software downloads 2008-10-03
- Sony Bravia Internet Video Link (DMX-NV1)
- The moment Sony's Bravia Internet Video Link (also known as the BIVL or DMX-NV1) was announced last year, we knew the product would face an uphill battle. What could Sony's proprietary video streamer offer that you can't already get from Apple TV, Xbox 360, Sony PS3, Vudu, or the Netflix...
- Product reviews 2008-10-02
- Video: What's the difference between CIO and CTO?
- Video: What's the difference between CIO and CTO?Dont agree...You make it sound like CIO is the Infrastucture Guy and CTO is the Applications guy. - The basic difference is - CIO responsibility - RUN Information Technology as a business function supporting various units - CTO...
- Discussion threads 2008-10-02
- 14 ways IT screws up projects
- Successful projects require decent project execution. Look, no one's asking IT to save the world, but delivering projects really well should be a core IT function. Some projects are so bad that IT seems to deliberately shoot itself in the head. Sorry, but...
- Blog posts 2008-10-02
- VISCOM Image Viewer CP ActiveX Control (exe)
- BMP, GIF, ICO, JPEG, JPEG 2000, PCX, PNG, PSD, TIF, WMF, WBMP, TGA, PGX, RAS, PNM Image Viewer ActiveX / OCX. Read, write EXIF image information, binary data types for storage mark a selection, crop, zoom in, zoom out on selection, and rotate the image function. Draw overlay image with...
- Software downloads 2008-10-02
- AVConverter Technologies Video Converter (exe)
- Video Converter converts video formats: AVI, MPEG, MOV, RM) to VCD, DVD, and SVCD. Supports more TV systems: NTSC, PAL, NTSC-Film. Video Converter can convert a selected part as well as multiple files. It features high audio and video quality. The program supports drag and drop function. It is also...
- Software downloads 2008-10-02
- See Technical (exe)
- Symbol libraries, standard page formats, drawing tools, everything is just a mouse click away. Designed for those looking to increase productivity, See Technical is more efficient than any standard drawing package. Over 2000 standard symbols used in the following fields: Layouts, Electricity, Professional diagrams, Industrial Engineering (Hydraulic, Pneumatic), HVAC Air...
- Software downloads 2008-10-02
Neighboring Terms
Premier Vendor Content Whitepapers, webcasts & resources from our Power Center Sponsors
- BNET Industries
- Check out BNET's newest resource for managers and executives. Need to do research on your competitors? Don't have time to read every trade pub? BNET Industries is the new source for daily news, insights, and research on 11 major industries and 9,000 public companies.
-
- The technology industry from a different angle
-
- See what's hot in the auto industry
-
- Stay on top of the energy industry






