I noticed this unusual error..
I had written a program schedule.cpp. I wrote a modified version of the same program and saved it as schedulespt.cpp in the same folder. when i was checking the 2nd program since i did not get the right result, it showed segmentation fault . It showed error at some memory location. And i had not used much of pointers in that program. But the first program i.e schedule.cpp was working perfectly.
When i moved schedule.cpp to a different folder, the new one started working and i got the result i wanted and there was absolutely no error. Its so stupid. i haven't experienced this error before. y did this happen????????
Nopes... i removed all the pointers i had used.... only the first program had pointers, but that was working fine... the 2nd one i wrote it without pointers..
i m still little confused... i brought the first program where the 2nd program is saved and again the same error, 2nd one shows segmentation fault. when i move it to some other folder i works... :D .... how come?
I'm not familiar with how Dev C++ links object files but linkers in general, will allow more than one copy of the same function/method to be defined in different object files. This is also true when linking libraries. The linker will just use the one from the object file it links in first and then discards any others. I suspect the objects from both of these files were part of you seg'ing executable and the different implementations were conflicting with each other. Did you use the same class/method names in both files?