473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

strstream.h header file?

hi all,i need this header file can anyone send it.thanks all.

Sep 25 '05 #1
8 14171

berkay wrote:
hi all,i need this header file can anyone send it.thanks all.


<strstream.h> is not part of the C++ standard.

<strstream>, which is the extensionless version, is currently part of
the C++ standard, although it's depricated.

If you which to use this depricated header, use the extensionless
version, which your C++ compiler should support.

#include <strstream>
using namespace std;

However, I recommend you use stringstream instead

Sep 25 '05 #2
Daw
How about using sstream-header?

Sep 25 '05 #3
"Daw" <da****@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
| How about using sstream-header?
|

Thats what he meant when he said use stringstream instead. Doesn't it
make sense that the OP first learn about stringstream before considering
whether or not to include <sstream>?

A stringstream is a completly different animal than anything found in
the old strstream header.

For the OP: stringstreams are definitely the way to go and well worth
the effort. The deprecated strstream's components are reknown for silent
failures and other issues that generate buggy code. strstreams deal with
char* while stringstreams deal with std::strings. You'll find that
implementing stringstreams will fix many a program that rely on the old
header.

http://www.cplusplus.com/ref/iostream/stringstream/
http://www.cplusplus.com/ref/iostrea...ingstream.html
http://www.cplusplus.com/ref/iostrea...ingstream.html
Sep 25 '05 #4
thanks all,i ll use sstream but i still have a problem
#include <iostream>
#include <sstream>

using namespace std;
void main(){
char arr[20];
cin.getline(arr,sizeof(arr),'\n');
ostringstream sout1(arr,sizeof(arr));

cout<<sout1.str()<<endl;
//cout<<sout1.pcount()<<endl;
//this works if i use strstream,what must i use to
return the number of bytes currently stored in the buffer

Sep 25 '05 #5
berkay wrote:
thanks all,i ll use sstream but i still have a problem
#include <iostream>
#include <sstream>

using namespace std;
void main(){
char arr[20];
cin.getline(arr,sizeof(arr),'\n');
ostringstream sout1(arr,sizeof(arr));

cout<<sout1.str()<<endl;
//cout<<sout1.pcount()<<endl;
//this works if i use strstream,what must i use to
return the number of bytes currently stored in the buffer


That is a wierd way to use ostringstream. When you use ostringstream you
normally start with the buffer empty.

ostringstream sout1;

Not quite sure what you are trying to achieve there so I can't really
advise what you should be doing instead.

But to answer your question

sout1.str().size()

returns the number of bytes currently in the stringstream.

john
Sep 25 '05 #6
yes,it is the thing i need thanks a lot.it works but i couldnt find
this function in cplusplus.com do u have any other resources?

Sep 25 '05 #7
berkay wrote:
yes,it is the thing i need thanks a lot.it works but i couldnt find
this function in cplusplus.com do u have any other resources?


I use this site

http://www.dinkumware.com/refxcpp.html

john
Sep 25 '05 #8
thanks

Sep 25 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Newsgroup - Ann | last post by:
I have a library function like GetOptions( ..., struct net_arch_t netArch, ....) and put the declaration into a regular header file like getopt.h. But this function declaration also needs the...
15
by: Kannan Goundan | last post by:
Maintaining a C++ header file can be painful. I want a way to automatically generate header files from the implementation file. Does anybody know of a program that does this? If not, I'd like...
3
by: Sujan Datta | last post by:
What are the possible effects of modifying an existing header file, which includes bunch of defines, function prototypes and some struct definitions. The structure of the header file looks...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
9
by: chat | last post by:
Hi, every body. I have 3 files like this: -------------------------------------------------------- file name : header.h #ifndef TEST_H #define TEST_H int a=1; double b=0.5;
11
by: Gary Wessle | last post by:
Hi is it right to have a line like #include <path/to/header.hfor a library on my system, in my header file and use some functions provided by this library in the implementation file (file.cpp)...
7
by: The Cool Giraffe | last post by:
Please note that i do intend to use a header file. However, i'm not sure if it's really needed or just a convention. Suppose we have the following two files. // Something.h class Something {...
6
by: bobby | last post by:
hi group, Does the header file size or number in include(s) effect the size of executable file? In other world if i chose a large header file and include it with my source file does it increase...
6
by: Ramon | last post by:
Is there a way to initialize the variables (or other data) of a header file by using a function (similar to main() function)?? Thankx
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.