how can i write code in c that the two programs are run one after another
whithout the use of threads.

Recommended Answers

All 4 Replies

#include <stdlib.h>

int main(void)
{
    system("program1");
    system("program2");

    return 0;
}

@OP

How about a fork() + exec() ?

@OP

How about a fork() + exec() ?

How about CreateProcess?

system is ISO.

@Martin B

Thanks for pointing it out.

@OP

What i suggested was non-standard. So i guess using system(), as Martin B suggested, would be a better idea.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.