Windows autoclicker with a console interface
Here are some suggestions you can use to improve your code.

Formatting

Insert a space before a { that starts a compound statement and does not go on a separate line; e.g., instead of int main(){, write

int main() {


or

int main()
{


Place a space after a comma and after a control word (while, etc.):         SendInput(1, &amp;input, sizeof(INPUT)) and while (true) {.

Place two spaces around the = operator.

The indentation level of the leftClick function should be reduced to 4 spaces to keep consistent with main.

Naming

In C++, functions are usually named in snake_case instead of camelCase.  This is subjective though.

Standard library usage

Please try to avoid using namespace std; because it is considered bad practice.  The contents of the C++ standard library are put in a special namespace to avoid polluting the global namespace and causing name clashes.  The std namespace is not intended for use with using directives (in general).  using namespace std; forces you to avoid standard names and invalidates the purpose of the std namespace.  See Why is “using namespace std;” considered bad practice?.

std::endl is generally inferior to \n, but it is necessary in this case because of flushing requirements.  Good.

Currently, your code isn't clear in terms of unit of time.  Is the interval intended to be in seconds, milliseconds, or microseconds?  The standard &lt;chrono&gt; library solves this problem.  And instead of Sleep, use std::this_thread::sleep_for from &lt;thread&gt;, which plays well with &lt;chrono&gt;:

using namespace std::chrono_literals;

std::cout &lt;&lt; "Place the cursor where you want to click ..." &lt;&lt; std::endl;
std::this_thread::sleep_for(7s); // NB: valid syntax!


Indicate your presumed unit of time:

cout &lt;&lt; "Set the interval to click (ms): ";

int cinterval {0};
cin &gt;&gt; cinterval;

// ...
std::this_thread::sleep_for(std::chrono::milliseconds{cinterval});