a urgent help need regarding GCC

From: undisclosed on 29 Mar 2010 14:52
when i worked with Windows i will use DEV C++ compiler and i ll use
system(); to invoke the exe files..... now in Linux we don't have exe
files.... so how can i execute the executable files through a C
program..... in GCC system() is not present :) :) pl.. help me out....
thanks in advance , awaiting for ur reply :)

--
vignesh1988i

From: Jasen Betts on 30 Mar 2010 03:02
On 2010-03-29, undisclosed <undisclosed> wrote:>
> when i worked with Windows i will use DEV C++ compiler and i ll use
> system(); to invoke the exe files.....

> now in Linux we don't have exe files....

linux doesn't use file extensions like windows does.

just use the filename if it's in the path. If it's in the current
directory use ./filename or if it's elsewhere use the full pathname

> in GCC system() is not present :)

it was there last time I looked, perhaps you need.

#incldue <stdlib.h>

If you need more control of the way the program is executed you can use
fork() and exec(), but seeing as system() is enough on windows you probably
don't.

From: undisclosed on 30 Mar 2010 08:45
ok i ll try it out :) thank u :) i have another doubt... pl. help me :)

i have to run a C program in my gcc compiler... i need to find that
program's execution time in milli seconds :) i don't know how to do :(
plz. help me ...

waiting for the reply :) thanks

--
vignesh1988i

From: J.O. Aho on 30 Mar 2010 12:03
Jasen Betts wrote:> On 2010-03-29, undisclosed <undisclosed> wrote:
>> when i worked with Windows i will use DEV C++ compiler and i ll use
>> system(); to invoke the exe files.....
>
>> now in Linux we don't have exe files....
>
> linux doesn't use file extensions like windows does.
>
> just use the filename if it's in the path. If it's in the current
> directory use ./filename or if it's elsewhere use the full pathname
>
>> in GCC system() is not present :)
>
> it was there last time I looked, perhaps you need.
>
> #incldue <stdlib.h>
>
> If you need more control of the way the program is executed you can use
> fork() and exec(), but seeing as system() is enough on windows you probably
> don't.