Can't type anything while running code in netbeans

Ok so I'm having troubles with netbeans. When I run the code I can't type anything, i can only paste something and that's annoying. Let's just have a very simple example, here's the code:

    #include <iostream>

int main() {
    int number;
    std::cout << "Give me a number: " << std::endl;
    std::cin >> number;
    std::cout << "You gave me " << number << ". Thank you." << std::endl;
}

Ok when I hit run it shows me "Give me number". Under that text there is a white box which becomes black when i click it and i can't type anything, so only way to move forward is copying the number and the paste it.

Upvotes: 8

Views: 11336

Answers (5)

Hossam Mahmoud
Hossam Mahmoud

Reputation: 1

On your Netbeans IDE, Right click on your Project > Properties > Run > Console Type >> Then change it to external console.

This way "cin" will work with you and record your input.

Upvotes: 0

Nour Loay
Nour Loay

Reputation: 1

This problem happened to me and I solved it using this way:

Right click on your project > Properties > Run > Console Type > Standard Output

Upvotes: 0

Austin B
Austin B

Reputation: 190

ProjectName -> Properties -> Run -> Console -> Standard Output is I THINK what the original question was looking for.

Upvotes: 0

Max
Max

Reputation: 101

Adding to Vincent's explanation, I find that the correct console type is the External Terminal.

(Given that this question was over a year ago, this is mostly for the sake of future Googlers)

Upvotes: 7

Vincent
Vincent

Reputation: 666

You can try to change the console type :

Right click on your project > Properties > Run > Console Type

Upvotes: 15

Related Questions