Most voted "int" questions
A data type used to represent integers.
Learn more…114 questions
Sort by count of
-
1
votes1
answer56
viewsCheckbox values in array session as string
I intend to join in a array the values of a checkbox but how string and so that they are separated by array('string1','string2'), to be able to use in a mysql query IN('string1','string2'). These…
-
1
votes1
answer3328
viewsConcatenate string with integer
I have a variable that is a char vector, and in this vector I need to insert a number that is an integer, searching it for another variable: int quantidade; char id[3] = 'p'; For example, if the…
-
1
votes1
answer41
viewsHow to pass a "title" on an Int-like "Uialertcontroller" with Swift?
Good afternoon, you guys. I’m calling an Alert in my code where I need its "title" to be the return id of a JSON, my json object has id and status, the id is of type Int and the status is of type…
-
1
votes1
answer960
viewsHow to sort an array of objects in java
Hello, I have a class teams where they have scores (int), winning number (int), defeats (int) etc. Within the method main, I have an array of 20 teams and need to sort them by the score, if the…
-
1
votes2
answers1272
viewsConvert int to Hex
what I want to do is possible? convert the value variable to Hex. private void button1_Click(object sender, EventArgs e) { int value = 255; byte[] buffer = new byte[5]; buffer[0] = 0xff; buffer[1] =…
-
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
answer682
viewsProblem with dictionary - Attributeerror: 'int' Object has no attribute 'get'
I’m starting to learn the basics in Python, and one of the examples about dictionary lists asks for something like this: inventory = {'a' : 1 , 'b' : 6 , 'c' : 42 , 'd' : 1 , 'e' : 12} def…
-
1
votes1
answer609
viewsWorking with Hexadecimal in Java
I saw an example of code on the Java documentation site on bit that can be checked here. This class belongs to the example cited in link above: class BitDemo { public static void main(String[] args)…
java characteristic-language operators int hexadecimalasked 7 years, 5 months ago Pena Pintada 4,678 -
1
votes3
answers3361
viewsHow to convert 0 to null (Error inserting NULL into an INT field from a variable)
I am editing this question to be more didactic for other members, since there are only publications addressing this situation outside the community en. I own a field INT property UNIQUE that may…
-
1
votes1
answer667
viewsHow to prevent a variable from going negative in Java?
I’m making an application for Android in Android Studio where there is a list of items, where you can choose to increase or decrease the amount of each item, so for this I created two buttons for…
-
1
votes1
answer173
viewsError in covering from int to int*
I wanted to know why you are causing the error: Error converting int to int*' This program is only for training the use of pointers in parameters. void teste(int *t){ *t = 50; } int main(){ int x =…
-
1
votes1
answer145
viewsWhat is the difference between these forms of command execution?
These commands in Python: lista = eval('[' + input("Digite sua lista: ") + ']') And this: lista = input("Digite sua lista: ") And this: lista = [int(x) for x in input().strip()] Why the latter gives…
-
1
votes1
answer1916
viewsWarning: initialization makes integer from Pointer without a cast [-Wint-Conversion]
I have the following C code that connects to a mysql database and performs a query: #include <mysql.h> #include <stdio.h> int main(void){ MYSQL Connection; MYSQL_RES *res; MYSQL_ROW row;…
-
1
votes3
answers443
viewsGet Integer value in final . 00 and float value in . 01 to 0.9
I have this code below that is a calculator, but I have a problem: I wanted to return a value float when dividing 5 / 2 = 2.5 and returning an integer value when dividing 4 / 2 = 2 and not 2.0! Can…
-
1
votes0
answers70
viewsInteger conversion in Laravel Controller
I have the following data in the controller: $sheets = printerChange::select('folhas'); $sheetsNew = printerChange::select('folhasnew'); $sheetsCompare = (int)$sheetsNew; if(!is_null($sheetsCompare…
-
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
answer55
viewsVariable changes value without apparent reason in C
I’m writing a C code to solve the problem suggested in the Facebook post: https://www.facebook.com/groups/414761988665865/permalink/1390954547713266/ Can someone explain to me why you changed the…
-
1
votes1
answer125
viewsNumberformatexception: Invalid int: "1" I CAN’T CONVERT STRING TO INTEGER
I have a String = "1" and I can’t convert it to int, I think it might have something to do with the way it was built, the class that reads the TXT file from the web and saves it in the database is…
-
1
votes1
answer1533
viewsHow to convert a VARCHAR(30) FIELD WITH SPECIAL CHARACTERS TO NUMBER?
I have a seemingly simple question, but I’ve been racking my brain for a few hours, so I decided to ask for help. When executing the below query it normally executes. Select campo1, campo2 from…
-
0
votes1
answer797
viewsASCII value for char or Int value for ASCII C
Guys, I need to search for a value found by a rand in a file, I’m having a lot of problems because the rand returns me an integer and to fetch character in a file the fgetc me returns an integer…
-
0
votes2
answers206
viewsSum int with date - PHP
I have the function below, which makes the date sum, with the value +2 days fixed: echo date('d/m/Y', strtotime("+2 days",strtotime($ultima_data))); It sums correctly with the value of $last date,…
-
0
votes0
answers34
viewsParameters between Fragment and Activity
I have an Activity with a Fragment inside, but I want to pass the parameters present in the Fragment when changing from Activity, what I do?
string google-maps android-fragment android-activity intasked 7 years, 6 months ago william silva 21 -
0
votes1
answer265
viewsOutput of a void function
I’m programming a word hunt and a problem in the void function is making it difficult. In the code I use functions to scan the matrix in all directions and returns me the initial and final…
-
0
votes2
answers111
viewsIs it right to use string when the value is integer?
Today I came across a certain situation that left me in doubt: In my application I have some ID's from a table, these ID's are integer values (1,2,3, and so on) and I treat them all as string. One…
-
0
votes1
answer678
viewsHow to convert a string to an integer in a socket program?
Here is an excerpt from the code: def CriarServer(self): Host = self.Txt1.get() Port = self.Txt2.get() sockobj = socket(AF_INET, SOCK_STREAM) #Erro sockobj.bind((Host, Port)) sockobj.listen(5) while…
-
0
votes1
answer150
viewssprintf does not give the expected result
I have variables of the type Unsigned Long Int and would like to save its value in a string, to perform calculation of checksum and send via serial communication. void Payload(int long unsigned…
-
0
votes1
answer1079
viewsCompare integer and pointer
Well, I have a question, I’m trying to copy a line to a file but there’s an error that says I can’t compare an integer to a Pointer, can anyone help me? The error is on the line ch = getc(file1);…
-
0
votes0
answers673
viewsChange data type varchar to int
Is there a problem changing the data type from varchar to int in mysql? I have a spreadsheet with some items that were inserted as varchar, all are numbers. The problem is that I need to do a search…
-
0
votes1
answer28
viewsDesktop application position
Everybody good afternoon I’m having a problem I’ll try to explain: I created a desktop app and need your onscreen position to take a picture... first step catch posY,and X with getX,GetY, already…
-
0
votes1
answer867
viewsHow to convert a saved string into a . txt file, to an integer number?
Example: test = open('test.txt', 'w') test.write('6000') close-up test.() How do I convert the contents of the . txt file into integer so I can do operations with it? in case you have no way to do…
-
0
votes1
answer547
viewsPython to turn a number into an integer
import math x=9 raiz=math.sqrt(x) print raiz for i in range (raiz,9): #Problema aqui i=i**2 print i I need to create a for with the root of an operation (always whole. 2, 3,4,5...) but when I try to…
-
0
votes0
answers73
viewsDoubt about c# int [-1,1]
Good person, I made a script where he exchanges objects with setactive in int connected to onclick buttons 1,2,3,4 and so on I ask help from you to change the int to -1.1 on the onclick buttons the…
-
0
votes1
answer9962
viewsConverting int to string
I made a program that simulates a login and when converting the password that is int to string using sprintf it from segimentation falt, I tried to use itoa but it from the definition error #include…
-
0
votes0
answers39
viewsintval() changes values
Today I was making a web application working with $_REQUEST. However I noticed that when performing an UPDATE the value went wrong, and when I looked at the functions in php, that was the most…
-
0
votes3
answers9117
viewsconvert a string list into a list of integer numbers
x = ['443' , '552' , '342' , '368' , '9867' , '335' , '9412' , '7436' , '1692' , '85' , '990' , '332' , '8816' , '4567' , '279' , '119' , '2290' , '234' , '9863' , '345' , '230' , '5574' , '230' ,…
-
0
votes1
answer486
viewsInteger to String Conversion
I’m creating a cafeteria system. I created the login system and it’s working, when I went to create a page to create the logins, I’m having difficulties in converting the int for string - the…
-
0
votes1
answer237
viewsSet uint8_t to int
I am receiving data and in my project storing in an array of uint8_t and then processing in variable int, it’s okay that I could leave everything int but this does not apply to the project. int…
-
0
votes0
answers122
views"SIGSEGV ON THREAD", can someone help me to solve, and also, if possible, to complete the program?
Here’s the thing, I do an info tech, and I’ve been learning C for just two months, and I don’t know much yet. Recently my teacher asked me to make a program in which user entered with two numbers…
-
0
votes2
answers98
viewsValues in C do not return what is expected
I am in personal studies following a booklet that this algorithm gives the following result: Algorithm of the Apostille #include <stdio.h> #include <conio.h> main() { int n = 10; int m =…
-
0
votes2
answers1403
views -
0
votes0
answers411
viewsJava Beginner Doubt - Why is the result of the double variable wrong?
I made an algorithm that simulates a bank account, where the client can withdraw and deposit values, worked perfectly when I used variables like int, but when I use double type variables (in order…
-
0
votes1
answer43
viewsString conversion problems reading data in CSV
Personal greetings. I’m creating a program that reads data from a csv file. I’m having trouble reading a String and converting to int, because in the String reading is not removed the quotes ("").…
-
0
votes3
answers64
viewswhen I put a small number in my algorithm it works, but if the number is large the program returns 0
when I put a small number in my algorithm it works, but if the number is large the program returns 0, I tried to put unsigned int, long, etc and it didn’t work... Here’s the code: #include…
-
0
votes0
answers164
viewsCreate a column that shows SQL percentage
I have a query that searches 2 values and when divided should return the percentage, but this with integer number. I believe I’m wrong here : (COUNT(distinct neighborhood) / COUNT(distinct…
-
0
votes1
answer455
viewsProblem turning string into int: "error: no matching Function for call to stoi"
I’m writing a little show input a string of integer numbers as a string and as output an array with twice each of the numbers, also as a string. Despite the function atoi be indicated in that reply,…
-
0
votes1
answer293
viewsSave data from a txt file to an entire struct or manipulate struct. C
I have a txt file that follows the template below. I want to save the balance as int, but with fgets I can’t get it. I’m wanting to save as int, because after the data is taken the program sorts…
-
0
votes0
answers19
viewsArduin build error
my code on the Arduino void setup() { // put your setup code here, to run once: int pinoMotor = 11; int pinoBotao = 12; int on = 0; int estadoBotao; pinMode(pinoMotor, OUTPUT); pinMode(pinoBotao,…
-
0
votes1
answer38
viewsRepeated hunch
Hey, here’s my problem. I’m developing an application in c# (console) to learn c# and I’m having a problem that I can’t solve. First I draw the numbers that will be drawn: Random rnd = new Random();…
-
0
votes0
answers24
viewshow to resolve this error? (The argument type 'double' can’t be Assigned to the Parameter type 'int')
if (result & 1 == 1) { result = ~result; } var result1 = (result >> 1) * 0.00001; lList.add(result1); } while (index < len); the project is in . Dart in flutter error: "The argument…