Questions tagged as 'operadores'

2
answers

What does "!" mean before a code snippet?

There are many basic things that I do not know, for example how to read exactly this exclamation in the following way: if (!(periodoAnterior.Equals(dataReader["NOMEPERIODO"].ToString()))){ //... } Can anyone explain me? And taking advan...
asked by 25.04.2014 / 19:16
2
answers

What is the difference between * var ++ and * var + = 1?

I am writing a function with the signature: int increment(int *val) . My intention is to get an integer pointer, increment its value in 1 and return that value. The body of my function was as follows: int increment(int *val) { *...
asked by 22.11.2015 / 18:35
2
answers

What does the "=" operator mean?

I was seeing some solutions in JavaScript and in one case I saw this command line: return args.reduce((s, v) => s + v, 0); . But I do not know what the => operator means. What's his role?     
asked by 21.02.2016 / 01:09
2
answers

What are the operators | &?

I was analyzing a code and found some operators I do not know about: | , & , >> and% with%. What is the functionality of these operators? bits = h1 << 18 | h2 << 12 | h3 << 6 | h4; o1 = bits &g...
asked by 04.03.2015 / 14:28
2
answers

How does bit shift work in C / C ++?

I'd like to understand how bit shifting works in C / C ++ . I would also like to understand how the processor performs the calculations and how it handles all of this. I have some examples in C / C ++ : void USART_Init(unsigned int ubrr0)...
asked by 22.03.2014 / 15:08
2
answers

What does the "|=" operator in Python mean?

I was analyzing a code and I came across the |= operator, I would like to know what that means, and what is its practical application. Example: x |= y     
asked by 18.09.2017 / 13:48
1
answer

What is the double exclamation before the method call in Kotlin?

I'm studying Kotlin. I noticed that, in the conversion to type int , it is necessary to put the double exclamation ( !! ). Example: var input = readLine()!!.toInt(); Generally in other languages double exclamation is used to...
asked by 05.08.2017 / 22:02
3
answers

Why (1 == true) is "true" and (2 == true) is "false"?

I was explaining to a friend of mine the difference between == and === in PHP and wanted to demonstrate this through the javascript console. I was going to show him that in PHP, the following sentences would return TRUE w...
asked by 28.07.2015 / 17:01
4
answers

Is there a ternary operation in Python?

I often see several programming languages where a ternary operation is almost always identical. (x % 2 == 0) ? "par" : "impar" However, when I tried to do this in Python, it gave me an error: (x % 2 == 0) ? "par" : "impar" ^...
asked by 26.10.2016 / 18:35
2
answers

What is the name of the = operator in PHP used in arrays?

In PHP, when we are going to declare a array directly, we have the => operator. I know that in PHP we have -> , which is object separator , but I needed to give the name to => and could not explain. Wha...
asked by 28.07.2015 / 17:26