Questions tagged [conio]

A non-standard C library that enables users to move the cursor on Terminals and place characters at certain locations.

The conio library is a C library mostly provided by MS-DOS compilers to provide console input/output beyond what is provided by the C standard library.

Conio does not form part of the C standard library or ISO C, nor is it defined by POSIX. This means that the functions in the conio library vary somewhat between compilers.

111 questions
1
vote
2 answers

program to find minimum and maximum element of array using recursion

I want to find the Maximum and Minimum element of an array using recursion. Here is the program I've written, I've gone through the logic and its seem to be perfect. But when I compile the program the program get stuck after taking input. Here's my…
Danish Shah
  • 13
  • 1
  • 3
1
vote
3 answers

How to blink particular text continuously all time during input and output?

Here is my code which blinks 'Welcome' after user enter his name. 'Welcome' does not blink when user is writing his name. As user hits enter then caret goes into the while loop. Then caret position is set back to the coordinates of 'Welcome' & cout…
udit043
  • 1,610
  • 3
  • 22
  • 40
1
vote
1 answer

How to copy content of a line into string by giving line's coordinates

I want to know if there is any way to copy content of a line from console window into string. For example #include #include #include int main() { char a[10];int b; int x1,y1,x2,y2,x3,y3; x1=wherex();…
udit043
  • 1,610
  • 3
  • 22
  • 40
1
vote
2 answers

getting keyboard input in c using conio.h

I am trying to learn how to use graphics.h and conio.h libraries.I am developing a graphic program which i need to move a rectangle after keyboard input.ex: if player press right , rectangle should move right side.Problem is i don't know how to get…
user3524633
  • 71
  • 2
  • 11
1
vote
1 answer

Strange behavior with function parameters and getch()

I am running in to some strange behavior with calling functions with parameters that contain getch(). Take the following code for example: _Bool IsKeyDown(char c) { if(!kbhit()) return 0; char ch1 = getch(); printf("%c\n", c); …
NAME__
  • 625
  • 1
  • 7
  • 17
1
vote
1 answer

C++: Reading characters before pressing ENTER

for like few hours now, I am trying to figure out how to read characters from cin before pressing ENTER (by using threads). I know about conio.h library but I prefer not to use it. I wrote simple program that gets data from user and saves it in…
John Doe
  • 135
  • 1
  • 13
1
vote
1 answer

Using conio2 with Visual Studio 2010

I'm trying to use conio2.h to make a game for a college homework, but I can't find how to use it with Visual Studio 2010 Professional in Windows 7. All the guides I've found direct me to use DevCPP or another compiler/IDE, but that isn't a option…
0
votes
3 answers

C processor error for conio.h

#include "stdio.h" #include "conio.h" #include "stdlib.h" #define RANGE(i, min, max) (imax) ? 1: 0 int main (void ) { int r; do { do{ r=rand(); } while (RANGE(r, 1, 100)); printf("%d",…
Kabir
  • 43
  • 2
  • 2
  • 4
0
votes
1 answer

How to use graphics.h functions to implement a bouncing ball using c?

i'm trying to do a simple bouncing ball code ,my code below doesn't bounce the ball,it just makes it move when the enter button is used, what can I do to make the ball bounce by it self when the program is…
0
votes
1 answer

press q for quit and enter for continue

I have a do-while loop, and I want if I press ENTER key, the progress will continue, but q will finish the program. It is not working as the program will end straight away and does not wait for the user to enter the key. Code below is my main…
BZS
  • 1
  • 1
0
votes
0 answers

_kbhit() not integer when trying to sleep thread

i'm trying to make a stopwatch pause by making the thread sleep until a key is pressed, but _kbhit() will not return an integer? the error is displayed in the image below: i tried to a quick search but wasn't able to find a solution to my problem
chapel1337
  • 27
  • 5
0
votes
1 answer

Analog of conio.h

How can I replace conio.h? Unlike other similar functions, it does not require pressing Enter. Are there any analogues from the standard library? #include #include int main(void) { char c; unsigned i = 0; while (1)…
12iq
  • 83
  • 5
0
votes
0 answers

getting cjk character using getch not working only in Windows 10+

int a = getch(); int b = getch(); printf("%c%c", a, b); This code works fine in Windows 7 or earlier, but in Windows 10 I get letters that I didn't input because b always returns 151. Is there a way to fix this? The console code pages are the same;
0
votes
2 answers

this code gets printed multiple times after every increment on my mac . I cannot use any other way to solve the issue?

Made a digital clock using C program : This is a simple digital clock i made and the issue i am having is that every time the time gets incremented the printf gets printed . Since i am on mac i cant use . My expectation : I want the…
Som
  • 61
  • 1
  • 6
0
votes
0 answers

How can I implement getch() function like in conio.h or ncurses

I am new in C programming, but already have written few projects with it. Once I was playing with dosbox and Borland C++. I found, that in conio.h exists getch() function to get keyboard input without echoing. And I disappointed, that I have no…