If you do get "error while compiling", then please show it. We cannot help you to learn to read the error messages that your compiler gives you unless you show us the messages you get.
@keskiverto is correct, it helps us to read your code and to know the error.
That said, I did notice (by pasting this into a compiler and trying it):
1 2 3 4 5 6
int k;
int changekey(int c)
{
int c=k;
return k;
}
The complaint is telling you that c is a parameter, and then it is also declared as an integer inside the function (the first line of the function int c=k )
That said, I don't see what the plan is here. The input, c, is not used. Even if one removed the "int" in front of "c" in the function, that would assign the INPUT to k, then return k, doing nothing with c.
In member function 'std::string Caesar::encode(std::string)':
11:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
11:37: warning: operation on 'i' may be undefined [-Wsequence-point]
14:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
30:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
In member function 'std::string Caesar::decode(std::string)':
40:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
At global scope:
36:23: warning: unused parameter 'op' [-Wunused-parameter]
In member function 'int Caesar::changekey(int)':
47:7: error: declaration of 'int c' shadows a parameter
47:7: warning: unused variable 'c' [-Wunused-variable]
At global scope:
46:20: warning: unused parameter 'c' [-Wunused-parameter]
First, a "warning" does not actually abort compilation, even though it points to suspicious code.
comparison between signed and unsigned integer expressions
In i < me.length() the i is signed value and the string's length is unsigned. That could be apples to oranges situation (even though here it won't be).
Make the i unsigned, same type as me.length(). size_t i;
operation on 'i' may be undefined
What do you do here: for (i = 0; i < me.length(); i = i++ ) // why?
In the other loops: for (i = 0; i < me.length(); i++ )
How do you initialize the member k of class Ceasar?
unused parameter
A function takes a parameter, but does not use it. Ever.
What is the point of the parameter, if you don't need it?