i have one query which i am not able to solve please suggest me my problem is i have to open a filedescriptor and have to store the contents in streambuffer,
i,e
Expand|Select|Wrap|Line Numbers
- int main () {
- char ch;
- streambuf * pbuf;size_t size;
- ifstream istr(const char *)fd);
- pbuf = istr.rdbuf();
- while (pbuf->sgetc()!=EOF)
- {
- ch = pbuf->sbumpc();
- cout << ch;
- }
- istr.close();
- return 0;
- }
Expand|Select|Wrap|Line Numbers
- ifstream istr(const char *)fd);
if i simply give
Expand|Select|Wrap|Line Numbers
- ifstream istr(fd);
please helop me what to do but i want the result in <b>streambuffer</b> because this is the input for some other module in my project pleasesuggest what are the different way i can get so the i get the contents in <b>streambuffer.</b>
thanks in advance.