Questions tagged as 'operadores'

1
answer

How to differentiate "001" from "1" in PHP? [duplicate]

If I compare 001 and 1 in PHP, it gives a result that the numbers are identical! In fact it seems it is! How do I differentiate 1 from 001, treat each one as if it were different?     
asked by 20.08.2015 / 00:21
2
answers

How do I define operator = for a struct in c ++?

I have the following structure: struct PATH { vector<ARCO_TEMPO> rota; set<int> rotaAux; float COST; int nArcosVoyage; vector<bool> VisitedNodes; vector<vector<bool>> VisitedVertices; int head_no;...
asked by 03.04.2018 / 22:29
2
answers

Conditional operator?: is not working

I can not use the?: #include <stdio.h> int main() { int num1 = 10; int num2 = 20; int resposta; num1 < num2 ? printf("sim\n") : printf("nao\n"); // O erro acontece aqui ao compilar num1 < num2 ? resposta = 10 : respost...
asked by 04.02.2018 / 00:27
1
answer

A comparison between 2 char (s) is wrong

I am manipulating a string with a loop for... that generates a new string of it, starting and ending of a certain position (would be "Hello" in that case). > When I compare the return of the manipulation with another string con...
asked by 15.05.2016 / 15:56
1
answer

OR returns result not expected

I'm running this function SELECT COUNT(id) FROM 'system_stats' WHERE 'name' = 1 OR 0 AND 'us_id' = 0 It returns a value equal to 1, but this 1 does not, when I execute separately in that way, it returns me 0, why with OR does it ret...
asked by 29.12.2014 / 02:20
1
answer

How to use the ternary operator to determine what to display?

How can I properly use the Ternary Operator in JavaScript. I have the following code: var Requisitar = function(){ setTimeout(function(){ $.ajax({ url: 'https://steamgaug.es/api/v2', // Acesso direto a API success:...
asked by 20.02.2015 / 21:46
1
answer

Assignment Operator "=" javascript

I do the following: var d = new Date(); var dataInicial = new Date(2017, 5, 1); var dataFinal = new Date(2017, 5, 20); var percorreDatas = function(){ d = dataInicial; while(d <= dataFinal){ d.setDate(d.getDate()+1);...
asked by 26.05.2017 / 02:01
1
answer

Struct with vector is not working

I'm trying to use vectors and struct , but it's not working. #include <stdio.h> #include <stdlib.h> typedef struct Atleta { float notas[5]; } atleta; void receberNotas(atleta* l) { int i; for(i=0; i<5; i...
asked by 28.09.2016 / 00:59
2
answers

How to sum the column of a table in PHP

Good evening guys,  I bring in a table a result of a select of a bank, but in the result:    echo "". $ T_TOTAL. ""; I'm bringing in a variable because I had to make a treatment to get my result.    Question: How can I add the r...
asked by 07.01.2016 / 23:14
1
answer

Why can not I change the string this way?

When we have an int variable declared, and then a pointer to that variable: int x = 10; int *p = &x; To modify the variable x through the pointer, we have to do: *p = 20; However, when I declare: char *string = "ABCD"; And I t...
asked by 08.12.2015 / 17:21