Questions tagged as 'tipagem'

1
answer

Varchar or int for "type" fields

I have a type column with 6 options to save to the bank, is it best to save string as varchar or int and treat this in the front ? For example, when 1 is in the database, display certain string on the screen, and so on. I k...
asked by 17.10.2016 / 14:39
2
answers

What is the difference between the data types enum, struct and union in C?

I'm reading the GNU C manual and I'm in the Data Types section and I notice a certain similarity between% types of%,% with%, and% with%. Is the syntax the same, or is there something that differs between them? In which cases should I use which...
asked by 27.06.2016 / 19:59
1
answer

Limit the input stream to values of type int

#include <iostream> #include <limits> using std::cout; using std::cin; using std::endl; int getVar(int num); int getInt(int num); int main(){ int n; cout<<"Insira um inteiro. \n\n"; getInt(n); return 0 ; }...
asked by 09.01.2016 / 21:03
1
answer

Map a field of type CHAR in the database to a field of type bool in C #, with FluentNHibernate?

In the database I have a ATIVO field of type CHAR(1) , where 'T' = true and 'F' = false . Now, in my application I'm getting around this problem with a "gambiarra", where I mapped my Ativo attribute to string...
asked by 02.04.2014 / 19:55
1
answer

Assignment of operation in C

I do not understand why doing this operation, even if you have already declared r as float , if you do not put the cast operator it assigns a int . #include <stdio.h> void main() { float r; r = (float) 8 * 2...
asked by 21.08.2018 / 19:43
1
answer

Converting an nvarchar data type to a datetime data type resulted in a value outside the range

Line of code INSERT [dbo].[Shop_Goods] ([TemplateID], [Name], [Remark], [CategoryID], [Description], [Attack], [Defence], [Agility], [Luck], [Level], [Quality], [Pic], [MaxCount], [NeedSex], [NeedLevel], [CanStrengthen], [CanCompose], [CanDrop...
asked by 21.07.2016 / 17:00
1
answer

Unsigned modifier for integer type in C

The works say that this modifier causes the variable not to accept negative values, but when I compile this code: #include <stdio.h> void main() { unsigned int idade; idade = -3; /* Não existe idade negativa */ printf("Id...
asked by 02.10.2016 / 16:47
1
answer

Convert uint16_t to int

I'm doing a project where a distance detector stores distance in a uint16_t variable, and I need to turn it into int to make the comparisons, but I can not find anywhere how to do this. How to do?     
asked by 29.11.2017 / 04:27
1
answer

Typing a pointer to struct

I was suggested to build a linked list using the following struct as a node: typedef struct node *link; struct node{ int item; link next; }; As I did not understand what the pointer operator along with this typedef I...
asked by 03.10.2015 / 16:14
4
answers

What kind of data to use for sale ID

I have a Windows Form application developed in C # and with SQL database. One of the functions of the system is to carry out SALES for different companies and different POS (different point of sale), however, using a single database. I use ID...
asked by 18.10.2016 / 13:43