cygwin terminal converts my letters to numbers - c

I recently coded a '.C' file with scanf in order to take keyboard inputs. To my great surprise, the cygwin terminal converted all the letters I typed to numbers. My program ran properly though. The cygwin terminal just didn't show the correct input that I typed. It even converted some non-alphabet keys into symbols.
If I pressed the same alphabet key multiple times, the numbers (showing up in the cygwin terminal) would change each time I pressed the key. I talked to my computer science professor about this and he didn't know how to fix it.
Another thing to be noted is that my professor was able to use the cygwin executable(?) via the command terminal in order to run my '.C' file. When he ran the program in this way, the command terminal was able to accept letters.
I got the cygwin installation package from the GATech mirror website and this is the first error I've come across using cygwin.
I am using windows XP and netbeans to run the '.C' ;

check your .(bash)rc settings, try alternativ "consoles" (mintty, xterm,...)
...was able to use the cygwin executable...
they are still windows .exe files

Related

Facing an issue int the terminal of VS code

I am very new to coding, it being only 3 weeks until I have started to learn to code. I write very small codes as of now (like only 20-30 lines, maximum 44) Whenever I write a code, then run it, as you might know, that if I have written a code for finding if the number is prime or not, I have to write in the terminal, ./prime and then press enter, then input a number.
But, when I do that in my VS code software, when I write, ./prime and then press enter, it shows:
bash: ./prime: No such file or directory.
I observed that my teacher is using that terminal in git bash, so I installed GitHub and used git bash for it, still, this problem was occurring. My brother predicted that you might not be saving the file, do that and then play it on the terminal. I even did that, but still, it was happening. And this is happening with every code I am typing, all the 44 code files.
Idk if this is happening because I have missed to download a particular file of mingw, or is there a different method to do that, for windows(my OS), because my teacher uses mac
You need to compile your code before you execute.
In terminal run command gcc prime.c -o prime and then you are good to go with ./prime

codeblock exe keeps crashing instantly

I have made a c program with codeBlocks on windows 10, but the exe crashes as soon as I open it, actually it does not matter the program all exe produced by codeblocks won't run, maybe there are some problems with the settings? Cause if I run the program from inside codeBlocks it runs without problems, any suggestion?
You are compiling "command line programs", which don't open a window on their own. Since they apparently don't expect any user input they run to the end quite happily and quit.
If you want to run this type of programs, you need a shell, which provides a window.
This is a simple way to get one: Open a file explorer window and navigate to the directory containing your program. Click into the address bar so that it changes into a textual representation of the path. Replace all of it with the word cmd and press enter. Now the shell's window opens, commonly with white text on a black background. Enter the name of the program, and it will run.

CLion not running in Terminal

There's this bug with the placement of certain characters in the embedded terminal in CLion (the Run tab that pops up when you click the Run button), and I figured out that if I changed the terminal in CLion, that wouldn't happen. I changed the terminal to cmder, and it is all working now, except one thing: I can't figure out how to make CLion run the program to that terminal.
I tried changing the configuration, but all it did on run was open cmder but not execute the program (I had to run it manually, by writing the file name).
I wonder, what's the way to fix this, and make CLion directly run C programs on the terminal, instead of the Run tab?
Thank you.
The CLion run configuration always runs in the integreted run window. That is not a terminal emulator, and it cannot be changed so that it runs in an actual terminal emulator (like cmder).
Your best bet is to try to fix the "character placement" in the run window. Maybe ask a different question where you explain the issue, or if it's a clear bug, file a bug report for it.

Redirect programs directly to eclipse console

I am using eclipse cdt oxygen with mingw64 7.2.0 on windows 10 to write programs in c. Whenever I write programs that only outputs like:
printf("x\n");
The output got printed into the console. However when I write programs that asks for inputs, like:
c = getchar();
rather than going to the console, eclipse instead opens a terminal. I believe that is where you will type the input. This doesn't usually bother me, however my eyes are destroyed, I am using a screen reader and this terminal is somewhat inaccessible. It is usable, but can be very hard to use sometimes (E.G. my screen reader JAWS does not speak what I'm typing).
Is there a way for eclipse cdt to put all inputs and outputs directly to the console?
Unfortunately in this case eclipse console is read only. Better once compile and build your code go to the folder where it created your exe file and run that exe in command prompt and test.
open command prompt window (type cmd)
cd C:\path_to_your_exe\
yourexe
This will also help you in case your program takes command line parameters.

GBA programming with Visual HAM in C

I am interested in programming for the Game Boy Advance using the Visual HAM IDE in C. However, every time I build a project I get a message stating:
'make.exe' is not recognized as an internal or external command,
operable program or batch file.
I downloaded GnuWin32 and make. Then, inside the ham visual editor I clicked advanced, options and set the directory of the MAKE_MODE (I guess some kind of environment variable) to the directory where the make program is.
Any suggestions on how to get this to work?
I had the same problem. Reinstall the hole vham package to the desired destination from the get-go. You can find it here: www.jharbour.com/gba/ham-280-full-win32.zip
You can't move the folders around. Even if you change the PATH variables this problem will persist.
Find where on your system the make program is in. Probably in cygwin's /usr/bin. Add that path to your system dos path.
Windows with cygwin is a screwed up hybrid system. You probably have three paths going on at once. You have the cygwin one. If you open a cygwin shell and type make I bet it finds the make program. Then if you open a dos shell ( in accessories/command prompts ) I bet it won't find the make program.
You will need to add it. Every version of windows does this differently but it is generally under right click on my computer/properties/advanced/environment variables. You will need to add it there.
And finnally there is the path known to your ide (probably). I don't know HAM, but it looks like you already did whatever they told you.
When you are done you should be able to invoke "make" from the windows/dos command prompt.

Resources