In my calculus textbook I have the following definition of a continuously differentiable function of several variables on an open subset of its domain.
Function of several variables $f: X \subset \mathbb{R}^n \to \mathbb{R}$ is said to be continuously differentiable on an open set $E \subset \operatorname{int}X$, if all its partial derivatives $\frac{\partial f}{\partial x_i}, ~i=1,\ldots,n$ are continuous on $E$.
How can this definition be extended to arbitrary (not necessarily open) subset of the domain? My guess is to generalize the approach to defining a differentiable function on such subset from this MSE post (in essence, I just replaced differentiability with continuous differentiability there). So, I got the following definition:
Function of several variables $f: X \subset \mathbb{R}^n \to \mathbb{R}$ is said to be continuously differentiable on a set $E \subset \operatorname{int}X$ if there exists an open set $\widetilde E$ such that $E \subset \widetilde E \subset \operatorname{int}X$ and $f$ is continuously differentiable on $\widetilde E$.
Is the last definition correct? If not, what would be the correct definition (of a continuously differentiable function on a set $E \subset \operatorname{int}X$)?