-
February 20th, 2012, 02:34 AM
#27
Re: C++/C conversion to just C
Set a break point at
and step from there. The problem should show up after a couple of steps. Also...your formatting for the switch statement...seems rather odd to me. I would do something like:
Code:
switch (choice)
{
// accesses the functions
case 0:
Finished = 1;
break;
case 1:
addition(&reward);
break;
case 2:
subtraction(&reward);
break;
default :
printf("Error in input\n\n");
break;
}
Sure, it is more lines of code, but imagine each of the cases requiring 10 instructions. I think the way I have it above would be more clear. But, that is just a personal preference.
Last edited by Alterah; February 20th, 2012 at 02:38 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|