473,396 Members | 1,860 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,396 software developers and data experts.

std::basic_string<wchar_t>: segmentation fault while accessing any member functions

have a type given by:

typedef std::basic_string<wchar_t> mystringtype;

at one instacne of my program, i have a vairable called 'abc' of type
mystringtype. When i try to access the .c_str() or even .length()
functions, I get a segmentation fault. Is there a way to check what
exists in 'abc' because it's definitely holding something .. though
looks like some corrupt memory address ..

Jul 23 '05 #1
1 2561
On Thu, 21 Jul 2005 11:45:13 +0400, mufasa <so*****@gmail.com> wrote:
have a type given by:

typedef std::basic_string<wchar_t> mystringtype;

at one instacne of my program, i have a vairable called 'abc' of type
mystringtype. When i try to access the .c_str() or even .length()
functions, I get a segmentation fault.
Probably, you overwrited the memory used by the string.
Is there a way to check what
exists in 'abc' because it's definitely holding something .. though
looks like some corrupt memory address ..


Yes, use a debugger or dump the string's binary representation. Having
checked up the string implementation you can then map the binary dump with
string's members.

--
Maxim Yegorushkin
<fi****************@gmail.com>
Jul 23 '05 #2

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

Similar topics

14
by: Dylan Nicholson | last post by:
Been playing around with this all day, and haven't found a solution I like yet. Assuming some initial function: void foo(std::string& src) { src += "some fixed string"; src += bar(); src...
0
by: Rémi Peyronnet | last post by:
Hello, I have some link problems while using basic_string with another type (unsigned int in my case) This is a sample source : " #include <string>
8
by: davihigh | last post by:
My Friends: I am using std::ofstream (as well as ifstream), I hope that when i wrote in some std::string(...) with locale, ofstream can convert to UTF-8 encoding and save file to disk. So does...
5
by: wolverine | last post by:
Hi I want to know how to use basic_string with unsigned short (I have mentioned below why i have to do this). Could any tell me some good references in this topic. I am new to creating a new...
0
by: wolverine | last post by:
Hi I want to know how to use basic_string with unsigned short (I have mentioned below why i have to do this). Could any tell me some good references in this topic. I am new to creating a new...
1
by: Bit Byte | last post by:
Are there any macros for converting between these two string types ?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.