First-come first-serve job scheduling algorithm I tried to make the code for implementation of first-come first-serve job scheduling algorithm as used by operating systems.

How can I make it better?

I am using turbo C++ compiler

#include&lt;conio.h&gt;
#include&lt;iostream.h&gt;
#include&lt;dos.h&gt;
struct process//contains information about processes in waiting queue
{
    int waitt;
    int etime;
    char name[32];
    struct process * next;
};

void inc( struct process * q)//increases wait time of all processes in wait queue
{
     while(q!=0)
     {
         q-&gt;waitt++;
         q=q-&gt;next;
     }
}

int pop(struct process** q)//remove process from wait queue to run state returns wait time of process
{
    int wait=(*q)-&gt;waitt;
    struct process* t=*q;
    *q=(*q)-&gt;next;
    delete t;
    return wait;
}

void addnode(struct process** q)//add new process to wait queue
{
   struct process *temp=new (struct process);
   cout&lt;&lt;"\nEnter process name ";
   cin&gt;&gt;temp-&gt;name;
   do
   {
        cout&lt;&lt;"\nEnter process execution time ";
        cin&gt;&gt;temp-&gt;etime;
   }while(temp-&gt;etime&lt;=0);//to check valid input for process burst time
   temp-&gt;next=0;
   temp-&gt;waitt=0;
   if(*q==0)
   *q=temp;
   else
   {
        struct process* t=*q;
        while(t-&gt;next!=0)
        t=t-&gt;next;
        t-&gt;next=temp;
    }
}

int main(void)
{
    clrscr();
    int e=1,wait=0,p=0,tt=1;
    struct process* q=0,*t;
    //add first process
    addnode(&amp;q);
    e=q-&gt;etime;//Burst time of runing process
    cout&lt;&lt;"\nProcess "&lt;&lt;q-&gt;name&lt;&lt;" startedafter a wait time of "&lt;&lt;q-&gt;waitt;
    cout&lt;&lt;" time units \n";
    p++;
    wait=pop(&amp;q);
    do
    {
        //to check addition of new process
        if(kbhit())
        addnode(&amp;q);
        //increase wait time of waiting processes
        inc(q);
        //decrement time left for finishing of process
        e--;
        if(e==0)//if process ended
        {
            if(q!=0)/*if process is left in wait queue remove next process from wait queue and add  its wait time to total time*/
            {
                e=q-&gt;etime;
                cout&lt;&lt;"\n"&lt;&lt;q-&gt;name&lt;&lt;" started after a wait time of "&lt;&lt;q-&gt;waitt&lt;&lt;"time units\n";
                p++;
                wait+=pop(&amp;q);
             }
        }
        delay(100);
        cout&lt;&lt;tt++&lt;&lt;"  ";//to show total time units since start of first process
    }while(q!=0||e!=0);//if process ended also no process in wait queue end loop
    cout&lt;&lt;"\n\nTotal no. of prcesses executed ="&lt;&lt;p;
    cout&lt;&lt;"\nTotal wait time for all prcesses executed ="&lt;&lt;wait;
    cout&lt;&lt;"\nAverage wait time for prcesses executed ="&lt;&lt;wait/(float)p;
    getch();
    return 0;
}
I think this question would actually benefit from both a C review (just change the cout's to printf, etc) and a C++ review since you seem to be using a very C-orientated programming style.  

This post will be a C++ review.
Please note that the Turbo C++ compiler is not available to me, so my suggestions will revolve around the C++98/03 standard.

My first bit of advice would be to switch to an object-oriented approach.
Turn process into a class and create a second class, process_queue.  

In process, replace char name [32] with std::string name. This way, you don't have to worry about buffer overflows.  

Refactor inc(), pop(), and addnode() into member functions for the new class process_queue.

Make pop() return a process instead of an int. This is because you have a queue of processs, not a queue of ints.

Rename inc() to something more readable like increment_all_wait_times(). That's a long name, but your code will be self-documenting.  

Take out the user-input logic from inc(), pop(), and addnode().
This will improve their flexibility. 
A function should only do one thing, and do it well.

For function parameters, prefer the use of references over the use of pointers.
This will save you from having to check for NULL.

Here is an idea of what a process class might look like:  

class process
{
public:
    process (const std::string &amp;name, const int burst_time = 0, const int wait_time = 0) ;

    // getters
    std::string name () const ;
    int burst_time () const ;
    int wait_time () const ;
    const process* next () const ;
    process* next () ;

    void decrement_burst_time (const int time) ;

private:
    int burst_time_;
    int wait_time_;
    std::string name_;
    process *next_;

    friend  std::ostream&amp; operator&lt;&lt; (std::ostream &amp;os, const process &amp;proc) ; 
    friend class process_queue ;
};


This would encapsulate your variables and (for the most part) make them read-only.
Because the process_queue class is tightly coupled with this class, I would make it a friend class. There are two versions of the next() method for the sake of const-correctness. 

Here is an idea of what a process_queue class might look like:  

class process_queue
{
public:
    process_queue () ;
    ~process_queue () ;

    bool empty () const ;
    void add_node (const process &amp;proc) ;
    void increment_all_wait_times (const int wait) ;
    process pop () ;
    size_t size () const ;

    friend std::ostream &amp; operator&lt;&lt; (std::ostream &amp;os, const process_queue &amp;pq) ;

private:
    size_t size_ ;
    process *head_;
    process *tail_; // for O(1) insertions
}; 


This, once again, encapsulates your variables while still providing useful functionality.  

Here's what a constructor implementation might look like:

process::process (const std::string &amp;name, const int burst_time, const int wait_time) 
    : name_ (name), burst_time_ (burst_time), wait_time_ (wait_time), next_ (NULL)
{
}


What you see here is a constructor initialization list. It is important to initialize your variables or else you may suffer from subtle bugs.

Here is a destructor for the process_queue class:

process_queue::~process_queue ()
{
    while (size_ &gt; 0) {
        this-&gt;pop () ;
    }
}


This makes sure all of our resources (memory in this case) are cleaned up when an instance of this class goes out of scope. This strategy is called RAII. RAII is important for writing exception-safe code.

Here is an example implementation of all of the above combined (somewhat sloppily):  

#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;stdexcept&gt;

class process_queue ;

class process
{
public:
    process (const std::string &amp;name, const int burst_time = 0, const int wait_time = 0) ;

    std::string name () const ;
    int burst_time () const ;
    int wait_time () const ;
    const process* next () const ;
    process* next () ;

    void decrement_burst_time (const int time) ;

private:
    int burst_time_;
    int wait_time_;
    std::string name_;
    process *next_;

    friend  std::ostream&amp; operator&lt;&lt; (std::ostream &amp;os, const process &amp;proc) ; 
    friend class process_queue ;
};

process::process (const std::string &amp;name, const int burst_time, const int wait_time) 
    : name_ (name), burst_time_ (burst_time), wait_time_ (wait_time), next_ (NULL)
{
}

std::string process::name () const
{
    return name_ ;
}

int process::burst_time () const
{
    return burst_time_ ;
}

int process::wait_time () const
{
    return wait_time_ ;
}

const process* process::next () const
{
    return next_ ;
}

process* process::next ()
{
    return next_ ;
}

void process::decrement_burst_time (const int time)
{
    burst_time_ -= time ;
}

std::ostream &amp; operator&lt;&lt; (std::ostream &amp;os, const process &amp;proc)
{
    os  &lt;&lt; "{Name = " &lt;&lt; proc.name ()
        &lt;&lt; ", Wait time = " &lt;&lt; proc.wait_time ()
        &lt;&lt; ", Burst time = " &lt;&lt; proc.burst_time ()
        &lt;&lt; ", Next = " ;

    if (proc.next () != NULL) {
        os &lt;&lt; proc.next ()-&gt;name () ;
    }

    else {
        os &lt;&lt; "None" ;
    }

    os &lt;&lt; "}" ;

    return os ;
}

class process_queue
{
public:
    process_queue () ;
    ~process_queue () ;

    bool empty () const ;
    void add_node (const process &amp;proc) ;
    void increment_all_wait_times (const int wait) ;
    process pop () ;
    size_t size () const ;

    friend std::ostream &amp; operator&lt;&lt; (std::ostream &amp;os, const process_queue &amp;pq) ;

private:
    size_t size_ ;
    process *head_;
    process *tail_; // for O(1) insertions
};

process_queue::process_queue () : head_ (NULL), tail_ (NULL), size_ (0)
{
}

void process_queue::add_node (const process &amp;proc)
{
    process *temp = new process (proc) ;

    if (tail_ != NULL) {
        tail_-&gt;next_ = temp ;

        if (head_ == tail_) {
            head_-&gt;next_ = temp ;
        }

        tail_ = tail_-&gt;next_ ;  
    }

    else {
        tail_ = temp ;
        head_ = tail_ ;
    }

    ++size_ ;
}

void process_queue::increment_all_wait_times (const int wait)
{
    process *temp = head_ ;

    while (temp != NULL) {
        temp-&gt;wait_time_ += wait ;
        temp = temp-&gt;next_ ;
    }
}

// Pops the head off.
process process_queue::pop ()
{
    if (head_ == NULL) {
        throw std::range_error ("process_queue::pop() called while the process_queue was empty.") ;
    }

    process ret = *head_ ;
    process *temp = head_ ;
    head_ = head_-&gt;next_ ;
    delete temp ;
    --size_ ;

    return ret ;
}

bool process_queue::empty () const
{
    return (size_ == 0) ;
}

size_t process_queue::size () const
{
    return size_ ;
}

std::ostream &amp; operator&lt;&lt; (std::ostream &amp;os, const process_queue &amp;pq)
{
    process *temp = pq.head_ ;

    while (temp != NULL) {
        os &lt;&lt; *temp &lt;&lt; "\n" ;
        temp = temp-&gt;next () ;
    }

    return os ;
}

process_queue::~process_queue ()
{
    while (size_ &gt; 0) {
        this-&gt;pop () ;
    }
}

namespace scheduler
{
    void run_first_come_first_serve (process_queue &amp;pq)
    {
        std::cout &lt;&lt; "Running first-come-first-serve scheduler with no preemption." "\n" ;

        while (pq.empty () == false) {
            process proc = pq.pop () ;

            std::cout &lt;&lt; "Running " &lt;&lt; proc.name () &lt;&lt; "\n" ;

            std::cout &lt;&lt; proc.name () &lt;&lt; " finished running after " &lt;&lt; (proc.burst_time () + proc.wait_time ()) &lt;&lt; " ns." "\n" ; 
            pq.increment_all_wait_times (proc.burst_time ()) ;

            std::cout &lt;&lt; "Queue:\n" &lt;&lt; pq &lt;&lt; "\n" ;
        }
    }
}

int main(void)
{
    process notepad ("notepad.exe", 500) ;
    process firefox ("firefox.exe", 1500) ;
    process excel ("excel.exe", 100) ;
    process visual_studio ("visual studio.exe", 200) ;
    process super_virus ("super virus.exe", 1000) ;

    process_queue pq ;
    pq.add_node (notepad) ;
    pq.add_node (firefox) ;
    pq.add_node (excel) ;
    pq.add_node (visual_studio) ;
    pq.add_node (super_virus) ;

    scheduler::run_first_come_first_serve (pq) ;

    return 0 ;
}