Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
string-stream
- Page 1
Object Array/String Stream Question/Problem
Programming
Software Development
14 Years Ago
by Syrne
… { private: int x; int studentId;
string
firstName;
string
lastName; int scores[5]; double avg;…return false; } [/CODE] Okay, obviously
string
stream
is a problem here as I haven'…I have hardly any knowledge of
string
stream
, but that's not that big…
How to build a tree structure by tokenizing the wkt string stream
Programming
Software Development
14 Years Ago
by nikhilsamkumar
… WANT TO BUILD A TREE STRUCTURE BY TOKENIZING THE WKT
STRING
STREAM
( BELOW ). ALSO I WANT TO ACCESS AND STORE THE VALUES… REQUIRED TREE STRUCTURE FIGURE , PLEASE HELP ME OUT THANKS WKT
STRING
STREAM
: COMPD_CS["OSGB36 / British National Grid + ODN", PROJCS["…
Re: Object Array/String Stream Question/Problem
Programming
Software Development
14 Years Ago
by Syrne
… private: int x; int studentId;
string
firstName;
string
lastName; int scores[5]; double avg…public: Student(); Student(int sX,
string
fN,
string
lN); void setX(int i); …
string stream, operator<<, special handling for user class
Programming
Software Development
15 Years Ago
by TimeFractal
Hello, I need to simulate a
stream
which behaves exactly like a ostringstream, except when handling… if color is not the first obj passed to the
stream
}; [/code] Next I tried to emulate the entire …} console& (operator<<) ( std::
string
&s ) { std::cout << "
string
: " << s << …
Re: How to build a tree structure by tokenizing the wkt string stream
Programming
Software Development
14 Years Ago
by nikhilsamkumar
… main file ( attached ). the importfrmwkt function scans the
string
and tokenize the
string
, called from treebuild function. i am intially building the…
Re: string input segmentation fault on linux
Programming
Software Development
18 Years Ago
by FireSBurnsmuP
…a line from the file into a
string
string
tempString; // temp
string
to hold each word tempLine.push_back(… tempLine, ios_base::trunc ); /* a
string
stream
that holds the lines so I can…getline( inss, tempString, ' ') ) // get a
string
from inss, stopping at spaces { tempRow.push_back( tempString …
Re: Object Array/String Stream Question/Problem
Programming
Software Development
14 Years Ago
by thelamb
First of all, I'd like to congratulate you on making a good post, we don't see it too often anymore around here! Firstly, I would rename 'getStudent' to 'newStudent' or something simmilar, I think it reflects the purpose more accurately. Now, newStudent is responsible for gathering all the information needed to create a new student, imho it …
Re: Object Array/String Stream Question/Problem
Programming
Software Development
14 Years Ago
by Syrne
Wow, great response thank you! I'll get to work ASAP. :)
Re: Object Array/String Stream Question/Problem
Programming
Software Development
14 Years Ago
by thelamb
Hmm, both errors are fairly obvious (don't take that the wrong way ;)). Look how you declare newStudent, it takes one Student object, by reference. In the while loop you give it a Student* and an index. Do you understand why in this case userData is a pointer: [code=cpp] Student userData[2]; newStudent( userData ); [/code] If not, I will explain…
Re: Object Array/String Stream Question/Problem
Programming
Software Development
14 Years Ago
by Syrne
[QUOTE][I]Now the cin problem. I'm trying to find the words to explain what it is that you're doing wrong... but I fail to find them so I'll just show you how it should be done: cpp Syntax (Toggle Plain Text) 1. int iScore; 2. cin >> iScore; 3. 4. userData.setScores( iScore ); int iScore; cin >> …
Hex-String
Programming
Software Development
16 Years Ago
by Furtano
… and want to put them hexadecimal in a
string
stream
. Every Hex number should consist of 2 chars…;iostream> #include <sstream> #include <
string
> #include <iomanip> using namespace std; int… main (){ int number = 16;
string
test; stringstream out (stringstream::in | stringstream::out); for (…
Vector<string> stream
Programming
Software Development
15 Years Ago
by TrintiyNoe
…; using namespace std; void manage(vector <
string
> scoreSheet) { int i; stringstream q;
string
z; for(i=0;i<scoreSheet… expected this program to print the first word of each
string
in vector but is printing the first value over and…
Re: Vector<string> stream
Programming
Software Development
15 Years Ago
by TrintiyNoe
…=tux4life;908426]Nope, because you just get back the whole
string
, not the first word. And I think you meant: [ICODE… namespace std; int main() { int i; vector <
string
> scoresheet; stringstream q;
string
z; scoresheet.push_back("QWEr"); scoresheet.push_back…
Re: Vector<string> stream
Programming
Software Development
15 Years Ago
by tux4life
… std; int main() { int i; vector <
string
> scoresheet; //stringstream q; //Donot Declare the stringstream here….
string
z; scoresheet.push_back("QWEr"); scoresheet.push_back(&… he only wants the first word, not the whole
string
, so [ICODE]z=q.str();[/ICODE] is incorrect (…
Bluetooth string stream / transmit
Programming
Software Development
15 Years Ago
by leviaeon
… I am implementing this code that will transfer a
string
from mobile to a bluetooth device. I have already done… now here goes the problem I cant send a
string
to the bluetooth to be transmitted to our bluetooth … in advance. code: import sys import socket import inbox,
string
from time import ctime import codecs import os import e32…
Re: Vector<string> stream
Programming
Software Development
15 Years Ago
by tux4life
[QUOTE=Sky Diploma;908423]Wouldn't [code] stringstream q; q << scoreSheet;
string
x=q.str(); [/code] Do the trick?[/QUOTE] Nope, because you just get back the whole
string
, not the first word. And I think you meant: [ICODE]q << scoreSheet[B][i][/B];[/ICODE].
Re: Vector<string> stream
Programming
Software Development
15 Years Ago
by Sky Diploma
…> using namespace std; int main() { int i; vector <
string
> scoresheet; //stringstream q; //Donot Declare the stringstream here….
string
z; scoresheet.push_back("QWEr"); scoresheet.push_back("Q&…
Re: Vector<string> stream
Programming
Software Development
15 Years Ago
by Sky Diploma
Wouldn't [code] stringstream q; q << scoreSheet;
string
x=q.str(); [/code] Do the trick?
Re: Vector<string> stream
Programming
Software Development
15 Years Ago
by kvprajapati
Assign (empty) zero length
string
. [CODE=C++] for(i=0;i<scoresheet.size();i++) { q << scoresheet[i]; z=q.str(); cout<<z<<endl; q.str(""); } [/CODE]
Re: string stream, operator<<, special handling for user class
Programming
Software Development
15 Years Ago
by TimeFractal
ok. Problem solved. operator<< should not be a member function. Could someone enlighten me as to why this the case. [code] #include <iostream> #include <iomanip> class color { public: int i; }; class console { private: std::ostringstream oStr; public: std::ostringstream & display( void ) { return oStr; }…
string stream
Programming
Software Development
19 Years Ago
by bibo1978
hi, well my question may be very basic but can u help me I have a buffer that including my data which is binary data and I want to use the iostream to handle the buffer read/write, seek ... etc, I am using the strstream to do this, by setting the [INLINECODE]ios::binary[/INLINECODE] and [INLINECODE]ios::in[/INLINECODE] and [CODE]ios::out[/…
Re: string stream
Programming
Software Development
19 Years Ago
by bibo1978
I have tried to overload the strstream constructor and add the line below but I have a problem I couldn't access the bp or the _pptr provate members of streambuf (((*(ios*)(&(*(istream*)(&(*(iostream*)(this))))))).bp))._pptr = in;
Re: string stream
Programming
Software Development
19 Years Ago
by Ancient Dragon
dev-c++ doesn't like strstream header file and claims it is deprecated. you should consider tossing it out of your program and using either iostream to display stuff on the console window or fstream to read/write to a disk file.
Re: string stream
Programming
Software Development
19 Years Ago
by bibo1978
I don't want to output data to file I want to handle some buffered operation stsstream actually is IOstream and it works with binary data .. most of the job is done in the ststream but the problem is that I can't access the streambuf "bp member" of my strstream.
Re: string stream
Programming
Software Development
19 Years Ago
by Salem
Start by stating what the problem is you're trying to solve rather than imagining using strstream is the answer. Tell us the problem you're trying to solve, not how to fix your solution. Have you considered for example a vector of unsigned chars for storing your binary data? > but the problem is that I can't access the streambuf "bp …
Re: string stream
Programming
Software Development
19 Years Ago
by bibo1978
well actually I have an input buffered data more like 2-8 MB of data and I am doing some processing on it, I have done it with file IO so I am doing the processing on files, I need to seek data, read for the input buffered data, and for the output I need to write reallocate seek .. check integrity .. I used the iofstream and the program worked fine…
Re: Stream Problems
Programming
Software Development
14 Years Ago
by Sky Diploma
…(
stream
.good()); PrintStream(
stream
);
string
a="efg";
string
b="SkyDiploma"; ReplaceWithDifferentLength(
stream
,a,b);
stream
.seekg(0, ios_base::beg); assert(
stream
.good()); PrintStream(
stream
…
Re: Stream Problems
Programming
Software Development
14 Years Ago
by Arbus
… file and have it in the
string
.Insert the
string
"zzz" in the
string
that has the text read from…to insert the text "zzz") with the
string
(the
string
which has the inserted text along with other texts). …the text in the
string
. Replace the line with this
string
. Both does all the modifications in the
string
and rewriting it …
Re: Stream Problems
Programming
Software Development
14 Years Ago
by Narue
…that particular path unless it's an exercise in
stream
processing. Inserting and deleting with an inherently sequential… sink (input and output
stream
), and keep an intermediate buffer for matching the search
string
. If there's a… If the buffer eventually matches, write the replacement
string
, otherwise write the buffer and then the character that…
Re: Stream Problems
Programming
Software Development
14 Years Ago
by VernonDozier
…; } } cout << endl;
stream
.clear();
stream
.seekg(startPos); assert(
stream
.good()); } void ReplaceWithSameLength(iostream&
stream
, const
string
str1, const
string
str2) { int len1 = str1…
1
2
3
17
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
Backlink Auditor
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC