api's n function

Discussion in 'Computer Forum' started by dawn2rock, Feb 14, 2006.

  1. dawn2rock

    dawn2rock New Member

    can anyone tell me diff b/w api's n fuctions
     
  2. knight_guitar

    knight_guitar Lead Guitarist

    Dude it's better of u search for that on "Ask" or "whatis"

    But API's (Application Programming interface) , is totally different from functions i'll try to give u a brief example

    now taking API's first.. now JAVA as i said in some of my earlist posts that it got like "27 API's" , like "struts, swings, javascript, jsp, EJB's" etc. etc.

    but this might not clear ur doubts ok think this in the manner like there are different types of people around the world like "mangaloian, blondes, black, indians etc. etc." they all have 2 ears, 2 eyes , one nose etc. etc. there physical structure is quite same but they all speak different languages and follow different culture this won't be a perfect example of API's but it will give u an idea what API's are about

    now Functions

    Functions mean a little program, written on particular language and can be used for that particular language (depends on which platform u working)
    They are small programs , which can be call whenever they are required in main program or main function

    let's say..

    i've made this small function in C++

    Void show()

    {

    cout<<"\n hello";

    }

    now i can call this "show" function later in any of my program whenever i require ..like

    i can call that function later on in the main program

    so that's what's actually API's and Functions are !!

    u can get much stuffs from ASK and whatis.. if u did'nt understand what i tried to made ya understand there..
     
  3. light_of_erindi

    light_of_erindi New Member

    Functions can be called from anywhere within the scope of the program. They can be written by u, someone else or provided by the OS at runtime.
    The ones that r called at runtime by the OS r called APIs. i.e. an API is a set of functions provided by the platform u r working on.... maybe an OS or some middleware like JAVA, BREW etc. when u compile a program which uses API functions thecompiler does not put the call address of the function as it wud for conventional functions at the call location but instead places a MACRO of the API which has a format that is pre-determined by the OS/Middleware so that when execution reaches that point correct API is recognized by the OS.
     

Share This Page