int *p; *p = 10;
Dereferencing an uninitialized pointer has undefined behaviour.
int *q = new() int(10);
This is syntactically incorrect, as the following compiler message reveals:
main.cpp:7:18: error: expected expression-list or type-id int *q = new() int(10); ^
So, to answer the question…
int *q = new() int(10)be replaced by
int *q; *q = 10anywhere?
No. Neither may be used anywhere in a program.