Hello, guys. I have a problem with my simple C++ text editor - it compiles, but after doing anything whatsoever it gives segmentation fault.
Source code: http://pastebin.org/353844
(function readsmth isn't needed yet)
I hate sepples and I am not a sepples programmer, but here are a few things I observed.
a.push_back(" ");
If vectors are what I think they are, this will only add one element with the content of " ". Not sure what you're doing here, but if you assign values with a[pointery][pointerx]=abc;, and it looks like abc it a vector of char pointers, you're not pushing char pointers onto it, only strings.
2.You declare int x,y; at the top of the code, yet use int pointerx,pointery. With both you don't give them a starting value, meaning it could start with any value. It's odd, but when C++ gives you memory it can already have stuff in it if you don't set it explicitly yourself. You're also comparing it to the x, meaning it could go on almost forever not knowing the values.
Hopefully that helps.
Jesus H. Christ, just writing that gave me a migrane. I feel bad for C++ programmers and anyone that has to look at the awful language. This is why I stay with languages that avoid this kind of bull shit.