Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Console input during debugging in qt creator
Forum Update on Monday, May 27th 2025

Console input during debugging in qt creator

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vsashidh
    wrote on 29 Jan 2014, 12:31 last edited by
    #1

    When debugging a project with only one cpp file named CH2 which contains the following code:

    @#include <iostream>

    using namespace std;

    /*function prototypes */
    int combination(int n, int k);
    int fact(int n);

    int main()
    {
    int n,k;
    cout << "Enter the number of objects(n) : ";
    cin >> n;
    cout << "Enter the number to be chosen(k) : ";
    cin >> k;
    cout << "C(n,k) = " << combination(n,k) << endl;
    return 0;
    }

    int combination(int n, int k){
    return fact(n) / (fact(k) * fact(n-k));
    }

    int fact(int n){
    int factVal = 1;
    for(int i=2; i<=n ;i++)
    factVal *= n;
    return factVal;
    }
    @

    the debugger is asking for the input via the application output. And when I enter the input value nothing happens. Whereas running the project, a terminal window does opens up requesting for the inputs.

    I have already tried changing the terminal path to xterm and a symbolic link to the openTerminal script via Preferences -> Environment -> General.

    Please let me know how I can debug my code with console input.

    1 Reply Last reply
    0

    1/1

    29 Jan 2014, 12:31

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved