February 10th, 2013, 12:11 PM
Plz help me, got stock !!
I have 2 c program file, one of them is the main, and the other is
data_file.txt . I'm using Linux computer, and cant run the program.
first, I put both files in my home, then I wrote this:
but everytime I get this commment:
February 10th, 2013, 01:06 PM
can you please be more specific about your problem?
describe it in a way so that others can understand what you want to tell.
by the way, if a file has .txt extension that means it is a TEXT file, not a C program file.
February 10th, 2013, 02:15 PM
February 10th, 2013, 02:49 PM
A second C source file would not have a file extension of .txt, which instead is for text files. Do you instead mean that your program will read in that text file?
Originally Posted by hola2
I assume that you invoked gcc like this:
gcc main.c -o main
If not, then just what is that file main supposed to be?
When you run ls -a main (as I recall; if -a is wrong then somebody please correct), what are the permissions that ls displays for main? In particular, what are the execute permission? Commonly, after creating an executable you need to run chmod on it to add the executable permissions -- again, I'm working from memory here so if I got that wrong, somebody else please correct.
February 10th, 2013, 03:58 PM
Thanks alot for your reply,
actually my problem is that Im not familiar with c and dont have any basics on it, therefore I dont know exactly what is the "main" file for and what is the "data_file.txt" for !?
But, I guess that the "main" contain the program and the other is just data.
what I know that both of them are one program which is 100% correct and in some way it should work cause some other persons could run it
February 10th, 2013, 04:00 PM
Originally Posted by dwise1_aol
ls -a main
this give me "main"
February 10th, 2013, 05:03 PM
And did you try the other options? Should have been ls -l main. The main thing is to check the permissions of main.