# Alan Turing Halting Problem with C code which check how TM works

If we want to write to write a C code, to check if halting problem halts on a given input, how it will be ? I tried this code as shown below but stuck

int main(int argc, char * argv[])

{

if(argc < 2){ printf("Please input an executable and its input enclosed in double quotes\n"); exit(0);}


//and here argv[1] has the exe path and the input w. }

Is any better code possible? Please then explain it too

• I'm having serious trouble understanding what you are trying to ask. What do you mean by "halting problem halts on a given input"? A problem doesn't halt on input; a machine or program does. – Yuval Filmus Oct 12 '18 at 3:40
• We are not homework cheating service. What are your thoughts? What do you expect to gain from answer? Where is the code executing input? If you expect to get working C code then your question is off-topic here. – Evil Oct 12 '18 at 3:41
• I know halting problem undecidable.But that is how Alan turing thought there must be some macine, which works like modern computer, So, the connection of computer with halting problem, that I want to know in a code format. – Srestha Oct 12 '18 at 4:28
• I was reading about enigma code and then alan turing paper about "a machine which can thought" like articles. Now, why halting problem comes in "machine can thought" in this assumption? How it helped in modern computer designing? – Srestha Oct 12 '18 at 4:55
• Alan Turing did a lot of different things. The Enigma machine was not a "computer", in most senses of the word. And the Halting Problem was not needed (or necessarily even useful) in the designing of modern computers. Given that the halting problem is undecidable, it's unreasonable to try to write a program to do it. – Alex Meiburg Oct 12 '18 at 9:06