Unary operators require one parameter, so it's assuming that the operator should be a unary one as you are only supplying one parameter.
The operators you have listed are binary operators, so require two parameters.
Thanks for the snippets DaveyM69 - I've ended up with something similar. For now, to compare I'm using GetIndex(), but my converted code is constantly growing. Didn't know that CS is so much more complicated...
I don't believe C# is much more complicated with this; I think the real difference is that you'd typically let the overloaded operators be member functions in C++ and C# wants them to be static functions. So if you rewrite your C++ code to the static overloading, then you're already having the same code in C# and C++.
As a general rule, the quality of the answer you get is directly proportional to the quality of the question asked. Take your question for example. It's vague, broad in scope, not even a question, demonstrates lack of any research, does not demonstrate any effort on your part and does not make any sense to begin with. As a result you are going to get vague, broad answers that are probably not going to be of much help.
Bottom line: you want better answers then ask better questions.
Hello, I'm doing a project to send information from multiple serial ports over TCPIP network.
The approach I am using is as follows:
Use BackgroundWorker for each serial port that is used to capture the information received.
I use a common method to treat the information received and stored in a queue using locks.
//private String _datos;
Queue _cola = new Queue();
privatevoid bw_DoWork(object sender, DoWorkEventArgs e)
BackgroundWorker bw = sender as BackgroundWorker;
string port = (string)e.Argument;
//put all your serial port code here
SerialPort sprt = new SerialPort(port);
sprt.BaudRate = 4800;
sprt.Parity = Parity.None;
sprt.StopBits = StopBits.One;
sprt.DataBits = 8;
sprt.Handshake = Handshake.None;
string indata = sprt.ReadLine();
//update the graph
BeginInvoke((Action)(() = UpdateGraph(port)));
//user wants to stop the worker
privatevoid UpdateGraph(string port)
//messures is shared by several threads: you must lock it to access it safelylock (_cola)
string text = Leer();
//the curve has been updated so refresh the graph
I found that if I open several ports and FIFO is slower getting data extracting data, the program is "locked." So far all I do is get the information even RichTextBox, but the purpose is to send this data via socket to another computer.
I understand that I should make a thread to avoid these locks but how should do so within the BackgroundWorker?
Sir i just wanted to know the code for K-means Clustering on text documents !!
As the code is available in C#!
but I am not able to get it!
and I am new to this site!
So can anybody help me please!
Thanks a lot!
I am trying to setup a parent task with child task (task1) to run x number (100) of task then run a separate task (task2) 1 time then continue running task1, etc. continuous loop until total task (1000) are complete. Can I do this using the ContinueWith statement, can someone please give me an example or point me to one that shows how to do this.
It gives many example of the different ways to execute a Task
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch