I'm trying to overload a factorial operator, and I'm caught on recursion. Here is my code so far:
Is there any way I can use ! in the definition? Also, if I define a simple operator, it will not compile, giving the error: 'int operator!(int)' must have an argument of class or enumerated type. I redefined ! to simply multiply the number by itself. (number*number). Can anyone give me some pointers?Code:int operator!(int number); ... int operator!(int number) { int temp; temp = number*((number-1)!) return temp; }