Defining a variable j to be binary by setting the corresponding ctype[j]='B' does not change the bounds associated with that variable. Because a call to
CPXmipopt() fails if the value of the corresponding variable is not between 0 and 1 in the solution of the LP relaxation at the root of the search tree, explicitly setting the bounds of binary variables to 0 and 1 is recommended.Similarly, defining a variable j to be semicontinuous or semiinteger does not change the bounds for that variable, and you should assure that finite upper and lower bounds are assigned to each such variable before calling
CPXmipopt() .

The routine returns a zero on success, and a nonzero if an error occurs.
int CPXcopyctype (CPXCENVptr env, CPXLPptr lp, const char *xctype); 
The pointer to the CPLEX environment as returned by CPXopenCPLEX()
.
A pointer to a CPLEX problem object as returned by CPXcreateprob()
.
CPX_CONTINUOUS  'C'  continuous variable 
CPX_BINARY  'B'  binary variable 
CPX_INTEGER  'I'  general integer variable 
CPX_SEMICONT  'S'  semicontinuous variable 
CPX_SEMIINT  'N'  semiinteger variable 
status = CPXcopyctype (env, lp, ctype); 