Run input-based commands C


#1

Hi, so i’ve got the script package installed and i am able to run simple C programs.
However, is there anything that enables me to use input-based commands?
eg.

printf("ENTER:");
scanf("%c",&variable);
printf("your letter is: %c",variable);
output:
">>" ENTER: 
C
- - 
your letter is: C

thankful for any suggestions.


#2

It sounds like what you’re looking for is a C REPL, similar to the ones for Python or Ruby. Your example leaves out a number of standard C requirements … so it would seem that what you really want is a scripting language with C-like syntax, keywords and library … with a REPL.

I know there was the c-repl project, but I don’t know if it is still maintained. There might be a way to create a Jupyter kernel from this so that the hydrogen package could work.

It doesn’t appear that there are any packages that directly do this, no.