Click here to Skip to main content
13,868,893 members
Rate this:
Please Sign up or sign in to vote.
See more:
class Process
public int Pid;
public string name;
public int ExecutionTime;
public string Status;

public Process(int pd, string nm, int et, string st)
this.Pid = pd; = nm;
this.ExecutionTime = et;
this.Status = st;


public void enqueue(Process P ) //public void enqueue (int item)
if (rear == max - 1)
Console.WriteLine("Queue Overflow");
ele[++rear] = P.Pid; // ele[++rear] = item ;


 Q.enqueue(typeof(Process) );

What I have tried:

I want to add a process into queue which i have declared it into class Process while enquing that process how do i have to call it in function while executing with my type process mention in the last line of code -- Q.enqueue(typeof(Process) ); --
Updated 8-Dec-18 10:33am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You don't add a Type to the queue, you add an instance
Process p = new Process(...);

You do realise there is a generic Queue<T> class in the .Net collections?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web01 | 2.8.190214.1 | Last Updated 8 Dec 2018
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100