sigsegv - C++ - Empty method causing SIGSEV signal -


i'm making simple deck/card/hand object oriented system university assignment, , i've become stuck on problem.

i've set simple test class calls various methods in objects.

int main() { deck deck = deck(); deck.displaydeck(); deck.shuffle(); deck.displaydeck(); hand hand = hand(1); card* card; card = deck.dealnextcard(); hand.addcard(card); hand.ftring(); deck.displaydeck(); } 

the problem comes @ hand.ftring(). when call this, causes segmentation fault. weird thing is, contains no code.

in hand.cpp:

string hand::ftring() { } 

if remove it, runs completion. if add console output method, prints , crashes. i'm @ loss do, debugger states

program received signal sigsegv, segmentation fault. in ?? () () 

you declare returning string in ftring function, don't return anything. bad.


Comments