LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   help (https://www.linuxquestions.org/questions/programming-9/help-45469/)

franki_boy 02-15-2003 02:06 AM

help
 
hey guys,
e i have only recently installed red hat 8.0
and i tried 2 run a c program on it it compiles fine but doenst show any o/p i did the following logged on as root
it shows [root@localuser...]#
and then i did vi new.c
wrote the program
did esc :wq to come out
snd tired to exec it
i did
# gcc new.c -o new
i also tried
#gcc new.c
the program complies but when i type
#./a.out
or#./new it doesnt show me any o/p
could u pls help me
i would really be grateful
thanx

Palin 02-15-2003 02:09 AM

the only thing I can think of is permissions do you know what they are set to for that file?

franki_boy 02-15-2003 02:28 AM

what permissions r u talking about i logged on as root
and just created the file so wat permissions???

Palin 02-15-2003 02:46 AM

if you type ls -l in that directory it will list the file permissions

basically i was wondering if the file was allowed to execute on your machine.

moeminhtun 02-15-2003 03:23 AM

can you paste your program here?

franki_boy 02-15-2003 06:26 AM

its a simple hello world program
#include<stdio.h>
main()
{
printf("hello world");
}
there we go
thats it
now can u help me out??

moeminhtun 02-15-2003 06:40 AM

Ok.
put the "\n" at the end of the line.

like this.

printf("hello world\n");

franki_boy 02-15-2003 06:59 AM

hi again,
this is what the ls- l o/p shows me
rwxr-xr-x 1 root root 11352 Feb 15 14:53 new

moeminhtun 02-15-2003 07:19 AM

Have you put "\n"?

franki_boy 02-15-2003 07:38 AM

hey moe,
thankx a lot man.the /n thing really worked,but could u tell me why do i
need to actually enter \n i mean it should work without it shouldnt it??
anyways i have another problem nowmi downloaded xine vcd player(xine-ui-0.9.18cvs-030215.i586.rpm)
and also curl-7.10.3-1.i386.rpm installed it on red hat8.0 and when i type
xine in the console it opens up but after a few minutes my m/c logs out and
got to the text logon screen and then the gui screen does anyone know why this happens???

lackluster 02-15-2003 08:55 AM

m4yb3 u shuld g0 b4ck 2 w1nd0wz

moeminhtun 02-15-2003 10:51 AM

Quote:

Originally posted by franki_boy
hey moe,
thankx a lot man.the /n thing really worked,but could u tell me why do i
need to actually enter \n i mean it should work without it shouldnt it??

Actually it does print without "\n", but when the program exit, the command prompt overwrite the printed line so you can't see it. So you have to append "\n" and give the new line command so that you get back to command prompt only after the printed line. Make sense right?
But in windows, it is not the case I think.

moeminhtun 02-15-2003 10:56 AM

Quote:

Originally posted by franki_boy
hey moe,

anyways i have another problem nowmi downloaded xine vcd player(xine-ui-0.9.18cvs-030215.i586.rpm)
and also curl-7.10.3-1.i386.rpm installed it on red hat8.0 and when i type
xine in the console it opens up but after a few minutes my m/c logs out and
got to the text logon screen and then the gui screen does anyone know why this happens???

hmm.. I don't know much in that area. I think you should ask this in the Linux-general or Software forum so that you can get the answer faster. Only the programming guys are coming to this forum.
:)


All times are GMT -5. The time now is 11:53 PM.