How can I terminate an infinite loop in Turbo C

0 votes

I get caught in an infinite loop. 

How can I break this cycle? 

Cntrl-C was attempted, however it had little effect. 

I have no idea how to stop it.

main()
{
     while (1)
     {
          char ch;
          printf("Enter a character: \n");
          ch = getche();
          printf("\nThe code for %c is %d.\n", ch, ch);
     }
}
Jul 13, 2022 in C++ by Nicholas
• 7,760 points
2,324 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In C++

0 votes
1 answer

How to use std::sort to sort an array in C++

We receive std::begin and std::end in C++0x/11, which are overloaded for arrays: #include <algorithm> int main(){ int v[2000]; ...READ MORE

answered Jun 1, 2022 in C++ by Damon
• 4,960 points
1,140 views
0 votes
1 answer

how could I use the power function in c/c++ without pow(), functions, or recursion

It is part of a series.  Replace pow() with the previous iteration's value. There is no need for code to call pow ().  Pow(x, 5 * I - 1) and pow(-1, I - 1) may be formed since both have an int exponent dependent on the iterator I from the previous loop iteration. Example: Let f(x, i) = pow(x, 5 * i ...READ MORE

answered Jun 21, 2022 in C++ by Damon
• 4,960 points
2,518 views
0 votes
1 answer

How can I get all the unique keys in a multimap

This method worked for me. for( multimap<char,int>::iterator it ...READ MORE

answered Jun 27, 2022 in C++ by Damon
• 4,960 points
1,499 views
0 votes
0 answers

How can I get the maximum or minimum value in a vector?

In C++, how can I find the greatest or minimum value in a vector? Is it correct to assume that it would be similar with an array? Do I require an iterator?  I tried max element, but I kept receiving errors. vector<int>::const_iterator it; it = max_element(cloud.begin(), cloud.end()); error: request for ...READ MORE

Jun 27, 2022 in C++ by Nicholas
• 7,760 points
576 views
0 votes
0 answers

How do I declare a 2d array in C++ using new?

How do I declare a two-dimensional array using new? For example, for a "typical" array, I would:      int* ary = new int[Size] but int** ...READ MORE

Jul 15, 2022 in C++ by Nicholas
• 7,760 points
492 views
0 votes
0 answers

How to declare an array of strings in C++?

I am trying to iterate over all ...READ MORE

Jul 26, 2022 in C++ by Nicholas
• 7,760 points
548 views
0 votes
1 answer

Difference between Turbo C++ and Borland C++ compiler [closed]

I will try my best to respond, ...READ MORE

answered Jun 21, 2022 in C++ by Damon
• 4,960 points
1,172 views
0 votes
0 answers

How to copy turbo c++ output?

How can I replicate the output of Turbo C++?  I had already Googled the issue, but in vain.  It suggests to either print scrn and paste or right click, select all, and paste.  I tried both, but neither worked.  The issue is that it simply copies what is on the current screen.  But I want the entire screen from the start.  (Alt+printscrn is also ineffective).  What should I do in this situation? printScrn Alt+printScrn markall None of them are operational!! I can't assist you if you require this archaic technique of programming for whatever reason, but I'd want to find a solution.  I tried forwarding the output stream to the file in this manner, but it did not work. #include<iostream.h> #include<conio.h> #include<stdlib.h> const int max=50; class dequeue{ int dq[max],r,f,c,x,i; public: dequeue(); void insertRear(); void insertFront(); void ...READ MORE

Jul 7, 2022 in C++ by Nicholas
• 7,760 points
1,439 views
0 votes
1 answer

setuptools: build shared libary from C++ code, then build Cython wrapper linked to shared libary

There is a seemingly undocumented feature of setup that ...READ MORE

answered Sep 11, 2018 in Python by Priyaj
• 58,020 points
691 views
0 votes
1 answer

setuptools: build shared libary from C++ code, then build Cython wrapper linked to shared libary

There is a seemingly undocumented feature of setup that ...READ MORE

answered Sep 21, 2018 in Python by Priyaj
• 58,020 points
2,393 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP