Wednesday, April 30, 2008

abt C programming

#include
#include
int main()
{
char *line=(char *)malloc(30*sizeof(char)); // change this code.
FILE *fp;
fp=fopen("hello.txt","r");
if(fp==NULL)
{
printf("file not opened");
}
else
{
printf("welcome\n");
//getline(fp,line,30);
//remove this line
fgets(line,30,fp); // add this line
printf("%s",line);
fclose(fp);
}
return 0;
}

My first Blog...

Thanks to my friend CS for introducing this wonderful concept of blogging 2 me...

A techie's dream