2

I have two streams from where I am getting the data. I would like to output a stream sorted by indexes of two current stream. for simplicity here is sample code:

While (1)
{
read.stream1(buffer1,size);
read.stream2(buffer2,size);


int index1 = (int) buffer1[20];
int index2 = (int) buffer2[20];


///// This is the part which I have to do:
sort based on the index, which ever index is small 
send that.
outputbuffer = Sort(index1,buffer1,index2,buffer2);
/////

outputstream.send(outputbuffer);

}

we have no information about the incomings of indexes, its like continuous sorting of data stream i.e serialization.

Josip Ivic
  • 3,639
  • 9
  • 39
  • 57
user3217310
  • 144
  • 1
  • 17
  • It's not clear to me what the indexes contain. The example code reads data into buffers, then sets index1 to the content of buffer1[20], and index2 to the content of buffer2[20]. Perhaps the idea was to declare index1 as a pointer to int, and then allocate (new) 20 integers for it? – rcgldr Oct 17 '15 at 07:39

0 Answers0