Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 1
Operators in C#
Hi, I'm currently unsure of the following operators in C#: & | ^ >> << What exactly are these? What do they do when they interact with numbers, booleans, and strings (or char)? For example, why does this input 1: int x=5; x &=3; Console.WriteLine(x); And of course what about the other operators? Thank you in advance!
11 Respostas
+ 3
Microsoft Documentation is probably a good place to know about it
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators
+ 2
Maybe you should continue the c# course and find out.
+ 1
Kamil Hamid I'm sorry if I offended you and you really tried to find the information yourself and just didn't find what you needed. Unfortunately there are *a lot* of people who post questions here without putting in any kind of effort. Questions that could easily be resolved with a quick search. Sorry again.
+ 1
C# provides a number of operators. Many of them are supported by theĀ built-in typesĀ and allow you to perform basic operations with values of those types. Those operators include the following groups:
Arithmetic operatorsĀ that perform arithmetic operations with numeric operands
Comparison operatorsĀ that compare numeric operands Boolean logical operatorsĀ that perform logical operations withĀ boolĀ operands
Bitwise and shift operatorsĀ that perform bitwise or shift operations with operands of the integral types
Equality operatorsĀ that check if their operands are equal or not.Typically, you canĀ overloadĀ those operators, that is, specify the operator behavior for the operands of a user-defined type.
The simplest C# expressions are literals (for example,Ā integerĀ andĀ realĀ numbers) and names of variables. You can combine them into complex expressions by using operators. OperatorĀ precedenceĀ andĀ associativityĀ determine the order in which the operations in an expression are performed.
0
@Simon Sauter,
I am currently looking on a different source and will eventually get onto this course, however I would appreciate if I could know. I could not find the answer which explains in a way I understand online, and I wish to know now to help with my CURRENT progression
0
@Simon Sauter,
I am afraid that doesn't help me find something which shows me when I have typed this question into a search engine
0
Thank you @Rellot's screwdriver
0
I find the information easily and quickly with a simple Google search, but OK. I realise that googling goes beyond some people's capabilities.
0
Simon Sauter
I donāt see why you have to be so offensive in messaging. Please can you appreciate that not all information is readily available. Search engines are not magical and donāt have everything which is very easy to find and not on the tenth search page
0
Simon Sauter
Thank you
- 1
In that case:
https://www.wikihow.com/Search-the-Internet