question about switch in function

At the very first part of my program,



#include <iostream>
using namespace std;

char Fd(0);

int command_f(char Fd)
{
//This is a function used for the input command F.
switch(Fd)
{
Case 'N' :
Rd = Rd + 5 - (Rd%5);
break;
Case 'E' :
Cd = Cd + 5 - (Cd%5);
break;
Case 'S' :
Rd = Rd - (Rd%5);
break;
Default :
Cd = Cd - (Cd%5);
break;
}
return;
}


please help me to check it
i dunno what's wrong with it
Last edited on
Am i mixing up the concept of local variables and global variables some sort of them?
if yes, please explain to me
thank you :)
You putted case with caps lock on first letter. It should be small letter. Second your default is in caps too. Remember C++ is case-sensitive. If Rd, Cd are global variables your code will work. If are not global your code will not work.
Topic archived. No new replies allowed.