I am currently working on a project, in which i need to pass object to a function. Based on this http://www.cplusplus.com/articles/z6vU7k9E/
I understood that what I am interested in is to pass my object as const pointer.
But for some reason am I keep failing at accomplishing this..
I am trying to pass the variable somethis.file as a pointer to the function specto.generate_spectogram() to the function, but for some reason is the way I am doing this is incorrect.
I don't see anything that is obviously wrong here. Personally I would have passed by reference instead of a pointer but it should work both ways. What error message do you get? If getNumChannels() has not been marked as const you would get an error on line 15 in spectogram.h because you can't call a non-const member function though a "const pointer".
I am getting a segmentation fault in the else statement, i can't can't copy my pointer vector to the internal vector, making me suspisous whether it is pointing t o the right thing..?