top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Why one should use API's in place of system calls in the code?

+1 vote
210 views
Why one should use API's in place of system calls in the code?
posted Jan 7, 2015 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

One reason could be "API provides abstraction from lower level implementation" .

answer Jan 11, 2015 by Vikram Singh
Similar Questions
+7 votes

If I have changed the no of parameter at some place where the function is being called. How can I be assured that no place is remain. Because build is successful, I cant not declare in header file because it is already extern in many files.

Brief example is given below.

/* main.c */
#include <stdio.h>
extern fun (int i ,int j);
int main()
{
printf("\n In main \n");
fun(1,3);
return 0;
}
======================================================
/* fun.c */
#include<stdio.h>

int fun(int in)
{
int local1 = in;
int local2 = *(&in +1);
printf("\nlocal1 = %d\tlocal2 = %d\n",local1, local2);
return in;
}
...