Questions tagged as 'operadores'

2
answers

Print of the result of a ternary operator

How to show the output of a ternary operation next to a string, using Python? I want to check if the size of the name you typed is greater than "Braga". For this condition, I want to use the Python ternary operator to check if it is "larger"...
asked by 22.11.2017 / 14:22
1
answer

The operator "==" can not be applied to operators of type "string" and "long"

Hello, good evening. I am doing a job for college in C # and I do not have much experience. I was running the program and the error described in the title appeared. The piece of code is this: public Produto BuscarProdutoPorCodigo(long codigoPr...
asked by 14.06.2018 / 22:23
2
answers

Transform string into operator

I have the following string '1 + 1', I have to transform the numbers into integers and perform the operation, you have to transform the string '+' into the + operator, or other operators like the '*' operation using if's, however how many operat...
asked by 22.09.2017 / 19:58
2
answers

If-else command is not working

In one of the exercises in a book I'm reading, I'm asked to trace a person's "profile" according to the year they were born (like those Facebook tests) but in order to limit the possibility of what is typed, I put a if to signal an error,...
asked by 05.04.2017 / 03:13
1
answer

How to sum the values in a loop?

I want to add and display the total value of the query. In the case of 3 patients the sum would be 1350. But something is going wrong. case 2 : printf ("Particular:\n"); printf("O valor da consulta e de R$ 450,00: \n"); for(i=0;i<3;i++) {...
asked by 26.05.2017 / 16:34
1
answer

How to overload the assignment operator in a class containing vector?

I would like to overload the assignment operator ( operator= ), I know I have to reserve memory, and copy data from one to the other, however I do not know how to copy one vector to the other without knowing the size of it . class Pe...
asked by 26.12.2016 / 21:40
1
answer

request for member 'attributeDisplay' in something not a structure or union

Tree initialization error, the problem with category variables and atributoOuDecisao . typedef struct node { int categoria; int atributoOuDecisao; struct node *prox; struct node *lista; } No; No *criaArvore(void){ No...
asked by 16.10.2016 / 20:12
1
answer

Ternary Conditional Operator

I'm trying to translate an if and else condition into ternary, but conditions are compounded, ie I need to indicate more than one statement on the same line. According to what I researched the same can be done using comma, but in the compiler...
asked by 09.04.2018 / 15:13
1
answer

What is this operator **? [duplicate]

What is this ** operator, and what is it for? Every time I come across a piece of code in C ++ with this operator. And if there is a relationship with * , what's the difference?     
asked by 28.12.2017 / 03:47
3
answers

What do these "and" operators mean? "[Duplicate]

The code below is part of an algorithm that shows the height of a binary tree: int left = height(p->left); int right= height(p->right); int larger = (left > right? left : right); return 1 + larger; What does this part (left &g...
asked by 06.12.2017 / 15:45