String Class operator+= Problem Programming Software Development by Frederick2 … void Print(bool); //Outputs String to Console with or without CrLf ~String(); //String Destructor private: TCHAR* pStrBuffer; //Holds String Buffer Allocated In Various Overloaded Constructors… Re: String Class operator+= Problem Programming Software Development by Frederick2 … are the private data members of my String Class… [CODE=C++] private: TCHAR* pStrBuffer; //Holds String Buffer Allocated In Various Overloaded Constructors And… length of the string controlled by ‘this’ plus the length to be added, i.e., strRight. If the buffer indicated by my… Re: buffer cout output and modify cout output order Programming Software Development by raigs … have to get the size of that buffer and cout a string stating that buffer's size. How can I achieve this…? 3. Then, cout that buffer's content. [CODE]#…lt; "cout output until this point"; string BUFFER; // I need to buffer the cout output until now. cout << … buffer cout output and modify cout output order Programming Software Development by raigs …, cout something and then cout the buffer? I've been googleing but did not …; "cout output until this point"; string BUFFER; // I need to buffer the cout output until now. cout <<…quot;Content-length: " + BUFFER.length(); // cout this first. cout << BUFFER; // cout the BUFFER after the: Content-length. cout.… String vs Stringbuffer Programming Software Development by musthafa.aj afaik, string is immutable and string buffer is mutable. when we concatenate characters with string new string object will be created. but when we append string buffer it remains the same object. apart from these what are the key and other difference between them?. String buffer overflow Programming Software Development by dodo_ind Hi all I'm using a 'STRING' variable to store the entire contents of a file. Is there any possibility of buffer overflow if the content of the file is large? (eg: say size of the file is 30MB). Thanks in advance Re: String buffer overflow Programming Software Development by Ancient Dragon Yes, there is a maximum size of a std::string object. [URL="http://www.cplusplus.com/reference/string/string/max_size.html"]Click here.[/URL] The output of the example code in the URL is this: [quote] size: 11 length: 11 capacity: 15 [color=red]max_size: 4,294,967,294[/color] Press any key to continue . . . [/quote] Re: String buffer overflow Programming Software Development by Alex Edwards … saw a developer mention a max size of the std::string class but didn't really investigate sources until recently. Here… hands if you pull a 30 MB file into a string. For example, if a megabyte is 1024 kilobytes and a… 251658240 bytes which is far under the limit of a string object. If MB means 1000 kilobytes and a kilobytes is… Re: String vs Stringbuffer Programming Software Development by zerocool21 string is a final class whereas stringbuffer is not Re: String array problem Programming Software Development by Nick Evan …] see some other issues: [CODE]void getData(ifstream& data, string array[100], int n) { n=0; while(!data.eof()) { data… you could betetr use getline(): [code=cplusplus] int array_counter = 0; string buffer; while (getline(data, buffer)) { in_array[array_counter] = buffer; array_counter++; } [/code] Standard C++ Library String Class Question About Underlying Buffer Size Programming Software Development by Frederick2 … way to pre-specify a specific string buffer size for the underlying buffer to which repeated concatenations are going …movements of characters from one buffer to another? I have tried the string::reserve() member but in my…quot;Five ","Six "}; string s2; s2.reserve(256); //Set buffer to 256??? printf("s2.capacity() =… how to build 2D Array from String Buffer Programming Software Development by shahab.burki … void tmFileReader() throws IOException { Work wrk=new Work(); StringBuffer buffer=new StringBuffer(); FileInputStream fstream = new FileInputStream(this.tmFileName); DataInputStream …array from it. [CODE]public void Simulate(StringBuffer myBuffer, String inputString,int number){ int length=myBuffer.length(); int i=0… Re: Passing string back from function Programming Software Development by nezachem …]pthread_create(&threads[t], NULL, dnssearch, (void *)buffer)[/CODE] I need to pass the string (buffer) to a function and the have the… function pass a string back. What am I doing… Identify string with variable? Programming Software Development by lochnessmonster [CODE] std::string function(std::string buffer) { int Variable1 = 23; if( !buffer.compare("Variable1")) <--- i want the user to …;--- How do i convert this number into a c++ std::string?[/U] } return "turd" [/CODE] Passing string back from function Programming Software Development by jeffhorton1965 …]pthread_create(&threads[t], NULL, dnssearch, (void *)buffer)[/CODE] I need to pass the string (buffer) to a function and the have the… function pass a string back. What am I doing… Question For Vivayan And Feedback On His STL String Program He Did For Me Programming Software Development by Frederick2 … "\r\n" ; typedef std::string::size_type size_type ; typedef std::string::iterator iterator ; int tick; tick=GetTickCount(); …;str.size() = %u\n",str.size()); { std::string temp ; temp.reserve(N1) ; iterator i = str.begin()… replacing any it finds, managing underlying string buffer memory as it goes. That is also… Break a string into groups of 3 characters Programming Software Development by neutralfox … my code: [code] int begindex =0, endindex = 3; String plaintext = null; String block; StringBuffer sbplaintext = new StringBuffer(); try{ while ((input = … 3; endindex += 3; } [/code] I got a string buffer "sbplaintext", (convert into string) and my objective is to make a group… Help - trying to marshall c++ char* to a vb.net string BYREF Programming Software Development by unclepauly … have a native c++ dll that creates and initializes a string, which is a char array. [CODE] char pRet[1024]; … and the callback function must change the value of the string. however, the callback function is in a VB.NET app… and the VB.NET app share and access the same string buffer ? many thanks in advance for any help, this has stumped… How Do I read in a file as text to a buffer? Programming Software Development by mimsc I have a jsp...I need to read in the generated html fron the jsp to a string buffer I can use in a mail method how do u do that? test.jsp Mutable String based on Linked List? Programming Software Development by overwraith If there is a String Buffer, and a String Builder based on array technology, why then is there no equivalent mutable data type based on a Linked List? Or is there? Re: Mutable String based on Linked List? Programming Software Development by overwraith I just created my own class based on this idea, and found that a class based on a linked list is much less efficient in runtime than the built in String Builder, and String Buffer classes. Thanks for the post on ropes and gap buffers, I will look at them. Reading a string buffer at the same "output line" as a previous text label Programming Software Development by InfernalDrake …) like this: [CODE=c] puts("SHELL>"); fgets(buffer,MAX_INPUT_LENGTH,stdin); [/CODE] but this snippet throws me this on… Re: Reading a string buffer at the same "output line" as a previous text label Programming Software Development by Ancient Dragon puts() adds the '\n' to the end of the string. call printf() instead [icode]printf("SHELL>");[/icode] &… Re: buffer cout output and modify cout output order Programming Software Development by Lerner "Content-length: " That is a string and this: BUFFER.length() equates to an int. So when you use…lt;< "Content-length: "; cout << BUFFER.length(); but everything between the << and ; operators …: cout << "Content-length: " + BUFFER.length(); is considered one object so it has to be… Re: String Class operator+= Problem Programming Software Development by MosaicFuneral Store the string length before hand, add the length of the two strings … to yours. [code]class String { private: size_t length; TCHAR *data; public: String size() { return(length); } &String::operator+=(const String& str) { size_t new_length… Re: String Class operator+= Problem Programming Software Development by Frederick2 …your point MosaicFuneral. I haven't been saving the string length of 'this' in any of my member …to when I first started to develop my own string class 3 or 4 years ago, I was…, that is. The way it is now my string lengths are being calculated in every member function call,… or so. So I've added a private string length member to my class, and I'm … Re: buffer cout output and modify cout output order Programming Software Development by raigs [QUOTE=Lerner;1024675]"Content-length: " That is a string and this: BUFFER.length() equates to an int.[/QUOTE] Yes, I made a mistake by concatenating a string and an integer when I drew up that example. But how can I buffer cout and modify the order they are output? Re: buffer cout output and modify cout output order Programming Software Development by Lerner Try another example so we can understand better what you are trying to do. This: cout << 4 + 7; works fine as does this: string word1 = "hello"; string word2 = " world"; cout << word1 + word2; but I'm not sure what you are thinking about. Re: String buffer overflow Programming Software Development by Alex Edwards Previous: strings can only hold a certain amount of data, so I'd assume so. Have you considered using the non-standard rope to meet your data needs? Or possibly a vector<char> implementation? Edit: Actually my previous post might need some more investigation, so I'm omitting it. My apologies. Re: How to reverse a string? Programming Software Development by redmaiev04 String reversing in Java is very tricky. I tried to use String buffer then do a for loop from the last character up to the first. I'm just a student like you, browsing for information.