![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using sed buffer | burakkilic | Shell Programming and Scripting | 1 | 12-14-2007 01:35 PM |
| Why is my buffer empty in vi? | cookiebooy | UNIX for Dummies Questions & Answers | 2 | 10-28-2007 02:17 PM |
| Buffer IO error | raybakh | Linux | 2 | 10-03-2006 06:41 PM |
| buffer the output | collins | High Level Programming | 6 | 11-08-2004 11:57 PM |
| About Buffer | Niko | UNIX for Advanced & Expert Users | 1 | 09-18-2001 12:49 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
problem with steam buffer
Hello experts,
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 Code: Code:
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;
}
Code: Code:
ifstream istr(const char *)fd); if i simply give Code: Code:
ifstream istr(fd); please helop me what to do but i want the result in streambuffer 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 streambuffer thanks in advance |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Code:
ifstream istr(const char *)fd); You have unbalanced parentheses and fd has not been declared. A std::ifstream can be constructed by giving it the name of the file from which to read as a const char*, e.g. Code:
ifstream istr("filename");
|
|||
| Google The UNIX and Linux Forums |