As Eddy states, those aren't Unary operators. This would indicate that these aren't the ones that are causing you problems. Could you post a sample that shows the code that the compiler is complaining about?
I was brought up to respect my elders. I don't respect many people nowadays.
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!
Last Visit: 31-Dec-99 19:00 Last Update: 29-Jan-23 11:57