I have to write a simple program to output 16 bytes of data to a file at 0 and 48th position and have come up with this program:
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
int main()
{
int f = create("test.tmp",774);
if(f>0)
{
write(f,"DEPARTMENT OF CS",16);
lseek(f,48,SEEK_SET);
write(f,"DEPARTMENT OF IS",16);
}
return 0;
}
What is wrong with this? It tells me when I compile using cc 7a.sh -ll that:
undefined to reference to ‘create’
There’s no function named
createIt’s named creat