even i tried in this way also
Code:
char ch[100]; pFile = fdopen (fd,"r"); fgets(ch, 90,pFile);
please tell me if any alternate solutions for this problem.
at the end i want the output in streambuffer.
char ch[100]; pFile = fdopen (fd,"r"); fgets(ch, 90,pFile);
int main () {
char ch;
streambuf * pbuf;size_t size;
ifstream istr(const char *)fd);
pbuf = istr.rdbuf();
while (pbuf->sgetc()!=EOF)
{
ch = pbuf->sbumpc();
while(1)
{
fgets(str,80,pFile);
if(feof(pFile))
break;
printf("%s",str);
}
while(fgets(str,80,pFile)!=null)
{
}
pFile = fopen ("al.odl","r");
while (!feof(pFile))
{
fgets(data, 80,pFile);
printf("%s", data);
}
fclose(pFile);
al : Object
{
initialize : Expr()
{
@Println("al loaded");
}
}
ifstream f(fd); streambuf * buf2=f.rdbuf();
ifstream f((const char *)fd) streambuf * buf2=f.rdbuf();
Leave a comment: