I am a newbie to the world of Linux, and i am trying to execute a C program that i wrote.<br>
<br>
I created a file called ctest.c, just a simple program: -<br>
<br>
#include <stdio.h><br>
int main()<br>
{<br>
int index;<br>
for(index=0; index<10; index++)<br>
{<br>
printf("A test program in Red Hat Linux 6.0\n");<br>
}<br>
return 0;<br>
}<br>
<br>
I compiled the program as follows: -<br>
<br>
gcc -o myprog ctest.c<br>
<br>
The program compiled successfully, but when i come to execute the prog with the following command: -<br>
<br>
. myprog<br>
<br>
I get the following error messagfe: -<br>
<br>
.:myprog: cannot execute binary file<br>
<br>
Can anyone tell me what i'm doing wrong?<br>
<br>
Any help would be much appreciated.<br>
<br>
Paul Welding.
<br>
I created a file called ctest.c, just a simple program: -<br>
<br>
#include <stdio.h><br>
int main()<br>
{<br>
int index;<br>
for(index=0; index<10; index++)<br>
{<br>
printf("A test program in Red Hat Linux 6.0\n");<br>
}<br>
return 0;<br>
}<br>
<br>
I compiled the program as follows: -<br>
<br>
gcc -o myprog ctest.c<br>
<br>
The program compiled successfully, but when i come to execute the prog with the following command: -<br>
<br>
. myprog<br>
<br>
I get the following error messagfe: -<br>
<br>
.:myprog: cannot execute binary file<br>
<br>
Can anyone tell me what i'm doing wrong?<br>
<br>
Any help would be much appreciated.<br>
<br>
Paul Welding.