i have two que’s how to insert one que into another que?(inserting whole que into another que)
In reply to lalithjithan:
You can use concatenation.
module top;
int q1[$],q2[$], position;
initial begin
q1 = {1,2,3,4};
q2 = {6,7,8,9};
position = 1;
q1 = { q1[0:position], q2, q1[position+1:$] };
$display("%p",q1);
end
endmodule
thankyou dave
In reply to lalithjithan:
module insert;
int queue1[$]={1,2,3,4};
int queue2[$]={6,7,8,9};
initial
begin
foreach(queue1[i])
queue1.insert (queue1.size(),queue2[i]);
$display("%p",queue1);
end
endmodule