segmentation fault
Hi,
I am using the gcc-3.3.3 which comes along with the FC2 release. When i tried to run a program i got a segmentation error in the following code
for(int i=0; i < temp.count; i++) {
temp.str[i] = new wchar_t[moods[i].length()]; //this will give u error for i=2
wcscpy(temp.str[i], moods[i].c_str());
}
Here moods[i].lengh() is 768 for i=2 and at that point it crashes.
bt is
0x0042cd58 in _int_malloc () from /lib/tls/libc.so.6
#1 0x0042c09d in malloc () from /lib/tls/libc.so.6
#2 0x001a43ae in operator new () from /usr/lib/libstdc++.so.5
#3 0x001a44df in operator new[] () from /usr/lib/libstdc++.so.5
What could be the problem?
pippet
|