hi all,i need this header file can anyone send it.thanks all. 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
How about using sstream-header?
"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
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
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
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?
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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...
|
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...
|
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
|
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:...
|
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;
| |
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
|
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 ();
|
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
|
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
|
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...
|
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,...
| |
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...
|
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...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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...
| |