I'm making a simple calculator using only +,-,*,/, and % as the operations. I'm having trouble as to why my code will not run. When i compile the code, it gives me "[Linker error] undefined reference to `displayResult(int, char, int)'" and "ld returned 1 exit status," as errors.
1. you can put the actual function of displayResult above the main function and remove the declaration of it.
2. you will need to make a .h file where you put the deceleration.
ad far as i know c++ does not like it the way you have right now. if i'm not mistaken though c would have no problem with it. it seems it works in visual studio, but i have had problems with different compilers on the subject
on second examination: it seems that the displayResult function is nested int the main function and it has a semicolen after the displayResult function, it wont work like this