473,794 Members | 2,752 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

strstream.h header file?

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

Sep 25 '05 #1
8 14196

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.c om> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.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,sizeo f(arr));

cout<<sout1.str ()<<endl;
//cout<<sout1.pco unt()<<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,sizeo f(arr));

cout<<sout1.str ()<<endl;
//cout<<sout1.pco unt()<<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().siz e()

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
3935
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 declaration of struct net_arch_t which is located in another header file, e.g., nn.h. I saw somewhere that it should be avoided to include another header file inside one header file. So I am trying to use some other methods. One option is for each...
15
7912
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 to try writing one. The input file would consist of function definitions and class definitions (with all methods defined inline). The program would extract all the signatures and place them in a header file. I can see some small problems...
3
2058
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 something like this //Start of header Define Define Define Define
0
3942
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. It is almost like it is trying to implement it's own COM interfaces... below is the header, and a link to the dll+code: Zip file with header, example, and DLL:...
9
4043
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
2813
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) inside a class with out declaring those functions in the class declaration in the header file? thanks
7
2251
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 { private: int number; public: Something ();
6
3436
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 the size of the executable outcome at the end? thanks
6
9471
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
9671
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10433
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10212
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6777
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2919
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.