hello everybody :)
here is a little program, that saves vector to a file, and read file to a vector...
it seems, that all is okey, except one thing,,, after program end comes message: *** glibc detected *** /home/aram/Dropbox/workspace/experimetlet/Debug/experimetlet: corrupted double-linked list: 0x00000000023b8100 ***
Switch from passing pointers to vectors to passing vectors themselves, by reference.
As written, your readfile receives a pointer to a vector, obtains a reference to the vector with k[0], and then makes a pointer to that vector, reinterprets it as char*, and trashes memory with read.
What it should do is take the vector by reference, obtain a reference to its first element with k[0], obtain a pointer to that element, reinterpret it and read the array with read.
EDIT: also, int size1=sizeof(k) is wrong and should be int size1=k.size(); (after making k a reference)
BIG BIG BIG thank YOU Cubbi, its work, and you are the best !!!! :)
YOU have not hesitated to look my code, and you are great, thank you again.
nevertheless its my first program that doing that kind of things(mean working with files) and i still can not
understand why its work now, and why it didn't before ,,, hahaahahah :-D
hey.
but some strange things still happening
wen trying to call after loading from file... for example vector_x[n].push_back(class_name(x,y,z))... program crashes :-(
why it can be...
also crash happens when trying to call vector_x[n].class_function().....
but before loading from file all works perfectly
IT IS STRANGE for me because
1. after loading vector from file, my program still can check some values from x_vector[n]...
it checks by loop whale x_vector, and if it find given ID(for example it at n-th element), then program checking its password, and if both are met it calls vector_x[n].menu();...
2. password check is another function in class_name... so, why all is ok while checking password with class function,
here it is: