In the below mentioned code, my intension is only to use the values which are received as a arguments. But unfortunately, I am able to change the “cStringVa l”. How to avoid this?
Code:
void setValue(const int * const intVal, const char * const cStringVal)
{
int length=0;
//*intVal = 50; //Error Can't change the value
//assign the another value
strcpy(cStringVal, "India");
}
Comment