Most voted "typing" questions
For data type system related issues.
Learn more…349 questions
Sort by count of
-
1
votes1
answer72
viewsCompiler accuses typing error when there is no typing error
I have the struct struct no { int numero[2]; std::string nome; float valorDoNome; struct no *esq, *dir; }; struct no *raiz, *aux1, *aux2,*favoritos; The function { raiz->valorDoNome=0; int…
-
1
votes1
answer798
views -
1
votes2
answers99
viewsWhat is the correct way to choose column types?
I always see tables as follows. Ex: CREATE TABLE posts ( id int(11) NOT NULL, titulo varchar(255) NOT NULL, autor varchar(255) NOT NULL, conteudo text NOT NULL, data varchar(11) NULL, )…
-
1
votes1
answer112
viewsHow is the signature check of the super function
The function super() serves to call the parent builder and verify suitable signatures. public class Pessoa { private String nome; private String endereco; private String telefone; private String…
-
1
votes1
answer51
viewsError collecting dynamic typing value
I’m having trouble collecting the values in a dynamic C typing. The inserted values as char, const char *, int, void * and long int work perfectly when placed in the printf (prints the value without…
-
1
votes1
answer74
views"A data type is an abstract concept defined by a set of logical properties." - What does that mean?
I’m reading the book "Data Structures Using C", and one of the things the book explains is that a set of bits has no intrinsic meaning, and that the meaning of a given set of bits is given to this…
-
1
votes0
answers685
viewsWhat is a statically typed language?
After reading a statement that weakly typed languages were bad, I researched the subject, and eventually discovered the term "statically typed". Here, in this SO question in English, it is said…
-
1
votes1
answer790
viewsError: incompatible types when assigning to type 'char[200]' from > type 'char'
When I try to insert the char motorista an error appears: [Error] incompatible types when assigning to type 'char[200]' from type 'char' Code: #include <stdio.h> #include <stdlib.h>…
-
1
votes1
answer158
viewsWhy a value of an input type number is a string and not a number?
I am wrong or if I take with javascript the value of an input type number it will be a string and not a number?
-
1
votes0
answers182
viewsDoes typing in PHP interfere with an application’s performance?
Out of curiosity, and by using it a lot without knowing if it is necessary, define the type of the variable is something I do in 100% of my code. It’s usually defined by something like this: class…
-
1
votes2
answers1681
viewsSuitable type to use with CPF is numerical or character?
I have a database with two tables that store the CPF. In one of them the CPF is stored as numeric(11,0) and in the other the number is stored as character. If there is any difference, which of the…
-
1
votes2
answers287
viewsInt, unsigned and Signed modifiers in C language
Algorithm "takes age": // idade deve sempre ser positiva, por isso vou usar unsigned unsigned int t1; printf("Digite sua idade:"); scanf("%d", &t1); printf("Idade: %d", t1); Doubt: Even if I…
-
1
votes1
answer519
views -
1
votes1
answer62
viewsError in the average calculation of a student record
printf("Nota 1: "); scanf("%.1f", &alu[n].not1); printf("Nota 2: "); scanf("%.1f", &alu[n].not2); alu[n].media = (alu[n].not1+alu[n].not2)/2; // o erro acontece NESSA LINHA invalid operands…
-
1
votes1
answer115
viewsDivision does not generate the expected result
When I do the division of mul / total_filhos_mul the variable mul is zeroed, if I don’t make this division she gets the correct value. What may be happening? #include <stdio.h> int main(){ int…
-
1
votes1
answer51
viewsNo startup error
I’m having a non-boot error, and I can’t figure out why: #include <stdio.h> int main(){ const int LENGTH = 10; const int WIDTH = 5; const char NEWLINE = "\n"; int area; area = LENGHT * WIDTH;…
-
1
votes3
answers737
viewsTemperature converter
When I type the temperature in Fahrenheint the program returns 0 as a result, where is the error? #include <cstdlib> #include <iostream> #include <conio.h> #include…
-
1
votes1
answer416
viewsHow to define in the parameters the type of arguments that should be sent?
Crude example of what I want (that doesn’t work): # -*- coding: utf-8 -*- def a(int(b), str(c)): # Isso não funciona, mas quero algo assim. print('Isso é um Numero: %i' %b) print('Isso eh uma…
-
1
votes1
answer541
viewsIs there a way to change the field type of a query in Delphi without having to exclude and include?
I have the following situation, I use Postgresql and Zeos in Delphixe, I needed to update the component to better support LATIN1 x UTF-8, now I can work with every type of character, blz. But…
-
1
votes1
answer61
views"Dynamic" data type is not the same as native data type
I’m trying to create a struct that has one of its attributes having its type of dynamic or varied data, I need ( when running the struct constructor) to be defined the data type of it, and it should…
-
1
votes1
answer43
viewsHow I define a unit of measure in the value of the variable
I have a question asking that I calculate the volume value of an oil can, and thinking about it I will use float. How do I place a unit of measure, for example the variable altura = 50cm.…
-
1
votes3
answers1572
viewsHow to read only whole numbers in the scanf?
For example, in the code: int main() { int x; scanf("%d", &x); printf("%d", x); } If I type "A", it automatically converts to whole or just closes the program (both happened to me). then, in…
-
1
votes2
answers61
viewsVariable keeps zeroed in a mathematical expression
My little show is like this: public void CalculaProporção() { decimal contagemSubida = 0 , contagemDescida = 0; int cSubida = 6, cDescida = 4, range = 10; contagemSubida +=…
-
1
votes1
answer445
viewsHow to get the exact value of the division with the decimal places after the comma?
I need to do a percentage calculation, but I’m not getting the exact amount. Example: int valorUni = 8; int valorTotal = 116; double result; result = (valorUni / valorTotal) * 100; //Resultado…
-
1
votes2
answers803
viewsError in assigning a value to a variable
I’m doing some algorithms on Visualg and came across the following error: Error in assigning values to variable d: REAL to INTEGER My code is this one: Algoritmo "acertoMiseravi" d: inteiro Inicio…
-
1
votes1
answer1326
viewsConcatenate a string with number in Typescript
I’m trying to add a 0 in the formatting of my date/month, but I’m not able to concatenate 0 with a string. I tried something like: var dd = dataAtual.getDate(); if (dd < 10) { dd = '0' + dd } I…
-
1
votes1
answer131
viewsWhat is the name given to an unsigned "overflow"?
Considering that answer in Soen would like to know what the nomenclature of when it occurs to try to store a value greater than the type unsigned int can contain as the result will be module…
-
1
votes2
answers104
viewsHow to correctly choose a data type
Normally I always programmed without paying much attention to it, always used int, float, double and so on, but more recently I saw a person commenting that currently float is a useless type because…
-
1
votes1
answer332
viewsSum of digits of a string only works when I do a subtraction I don’t understand
The program receives a string size up 10^6 and add the digits. I made the code, but to each loop 48 is added to the sum variable. If I modify the tenth line as soma = soma + nome[x] - 48 the problem…
-
1
votes1
answer384
viewsThere is no mapping of the System.Windows.Forms.Toolstriptextbox object type to a native type managed provider
I’m having a problem trying to make an appointment at a Select and bring the information on TextBox. There is no mapping of the System.Windows.Forms.Toolstriptextbox object type to a native type…
-
1
votes1
answer102
viewsHow does the return of functions in C work?
From what I’ve been seeing, every C function needs a comeback, whether I’m right or not? 1- What is the reason for this? It influences something? (I would like a logical explanation if possible). 2-…
-
1
votes2
answers1559
viewsCS0029 Error - Cannot implicitly convert "int" to "bool" as a function of C#
The code receives a user number and print if it is positive for True and if it is negative for False, only that there is a mistake of types going on and I don’t understand how to solve. using static…
-
1
votes2
answers214
viewsWhy does the value always return 0?
In the code below the result of the variable valor_1 always is 0. But reversing the order of the variables declaration to unsigned char valor_2, valor_1; the program works correctly. What’s the…
-
1
votes1
answer195
viewsWhy is the "long int" limit equal to the "int`"?
The boundary of type int is 2147483647, but the type limit long int is also 2147483647. Why the limit has not increased?
-
1
votes2
answers73
viewsError in a function that returns an AND of two variables in python
I made a function in Python that in theory should return a and of each element of two variables, however the result is not being expected. The answer would be [0, 1, 0, 0, 1, 1, 0, 0], but is…
-
1
votes1
answer149
viewsSQL Server Data Types
I have a question about the type of data real in SQL Server. I’m trying to store the value of 1.5 in a real type but it represents 1.5 as 1.5, wanted to know if when I was passing this value to a…
-
1
votes2
answers41
viewsDoubts with this function
I have this code in javascript and want to ask some questions: HTML <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport"…
-
1
votes1
answer175
viewsUnable to convert from decimal to double
The abstract class Figura has the virtual method CalculoArea(), where the derived classes called Quadrado, Retangulo and Circunferência override this method according to its geometric figure…
-
1
votes1
answer88
viewsFill variable with different types
I have many fields to pick up so it is very bad to make a function for each connection and they are uncharted banks so using something like the Entity Framework is also not feasible if (1 == 1) {…
-
1
votes1
answer123
viewsThe program is not recognizing whole number as such
a = int (input ("insira um número :")) if a != int : print ("isto não é um numero inteiro") else : print ("seu número foi :"+ str(a)) I’m trying to make a program where the user puts a value and the…
-
1
votes1
answer40
viewsWhat is the use of declaring a column as Char(0)?
I know that CHAR(0) is not defined in ANSI SQL, but in Mysql it is possible to define a column specifying this type of data. What would be the use/usefulness of such a column?…
-
1
votes1
answer112
viewsHow NOT to round up figures?
I need an exact value but my code always rounds down: float percentageUsed = 6050492416 / 8258998272; System.out.println(String.format("Porcentagem: %.2f", percentageUsed)); In case I had to return…
-
1
votes1
answer35
viewsReturning multiple auto variable types in C++14
I created a class, which has 4 attributes int valInt, float valFloat, double valDouble, bool valBool, and a method called getValue() of the auto type that returns the value according to another…
-
1
votes1
answer36
viewsHow to check the type of a unit test value using Jest?
I have a function that returns an object with two properties: name and id, where name will receive its value per parameter and id is generated automatically by Date.now(). My goal is to create a…
-
1
votes1
answer53
viewsHow to create a Union type from the elements of an array type in Typescript?
I have this code: const array = [1, 2, 3, 4, 5] interface data ... How do I get the contents of array and kind on date? As if it were so: interface data { numbers: 1 | 2 | 3 | 4 | 5 } PS: I nay I…
-
1
votes1
answer55
viewsHow to create a type from a variable in Typescript?
I need to create a type that, according to the variable value, uses a specific type. I have the following constant variables: const NEW = 'NEW_PROJECT'; const DELETE = 'DELETE_PROJECT'; The code is…
-
0
votes1
answer137
viewsIs comparing a variable to 1 the same as comparing it to true?
I have the following code: $(function() { var logado = _userdata["session_logged_in"]; if (logado == 1) { $('#rankPersonalizado').after('Você está logado.'); } }); Here: if (logado == 1) { 1 means…
-
0
votes1
answer38
viewsDoubt about getSource() instanceof
Instanceof is a binary operator that tests whether an object is the subtype of a certain type. Ex: Object fonte = e.getSource(); if (fonte instanceof JButton){ ... } If getSource() returned…
-
0
votes1
answer361
views -
0
votes1
answer129
viewsColumn type for support table
I have a client table and would like to create a support table to avoid creating many columns (address, phone, phone1, email, Email1, Email2, car plate, mother’s name, etc.). The support table…