Say, if I have an integer queue (or any class T), can I change the value of an element in the queue? More specifically, if I define the queue as follows:
Queue<int> q = new Queue<int>();
Can we change the value of our element in the same way as we deal with an array? (if q was an array, we could do something like this: q[0]=1to change its element). I just wanted to simplify the script and use int as an example, but my intention was to look into the 1st element of class T in the queue, do some calculations and update the queue for other programs to process. I do not want to cancel it, because the sequence in the queue will not be the same as the original. Hope what I'm trying to do. Please inform.
source
share