That's why it is an interview question, not a real question to be solved (in which case I would discard the pointers and maybe even discard the int variable). By ignoring the underlying problem: that you have been presented with an int** instead of the more natural int*, it shows that your hack misses the point of the question. I call it a hack because it involves two unnecessary reinterpret casts, one of which you did not make explicit and thus the compiler reported the warning.Why is this cheating? The interviewer doesn't specify WHY you cannot declare another variable. If it is for lack of memory then you couldn't use malloc(). If it is a problem of not wanting to have another variable then malloc is far better. Depends.