Category "int"

Invalid conversion from char * to int fpermissive

#include<iostream> #include<vector> using namespace std; int main(int argc,char** argv){ int n; if(argc>1) n=argv[0]; int* stuff=new int[n];

Convert float to int in Julia Lang

Is there a way to convert a floating number to int in Julia? I'm trying to convert a floating point number to a fixed precision number with the decimal part rep

Convert Int in Request Body to Long always

I wrote my backend in Java, and the endpoint is hit with a request body. The endpoint has a JSON body that looks like this {"id": 1234, "data": {...}} Now, I

myFile.write(item+"\n") TypeError: unsupported operand type(s) for +: 'int' and 'str'

Getting error: myFile.write(item+"\n") TypeError: unsupported operand type(s) for +: 'int' and 'str' and not sure why. Where shall I add the int? This i

How to round a Double to the nearest Int in swift?

I'm trying to make a calculator of growth rate (Double) that will round the result to the nearest Integer and recalculate from there, as such: let firstUsers =

In Python, how would you check if a number is one of the integer types?

In Python, how could you check if the type of a number is an integer without checking each integer type, i.e., 'int', 'numpy.int32', or 'numpy.int64'? I though

How to convert float to uint by float representation?

In C I will do this to convert float representation of number into DWORD. Take the value from the address and cast the content to DWORD. dwordVal = *(DWORD*)&a

"OverflowError: Python int too large to convert to C long" on windows but not mac

I am running the exact same code on both windows and mac, with python 3.5 64 bit. On windows, it looks like this: >>> import numpy as np >>>

How can I remove ".0" of float numbers?

Say I have a float number. If it is an integer (e.g. 1.0, 9.0, 36.0), I want to remove the ".0 (the decimal point and zero)" and write to stdout. For example, t

C++ concatenate two int arrays into one larger array

Is there a way to take two int arrays in C++ int * arr1; int * arr2; //pretend that in the lines below, we fill these two arrays with different //int values

How to sum the numbers(Int16) of stored core data - Swift 3

I have stored the letters(String), numbers(Int16) and Date(Date) in the core data. And the filter(NSPredicate) succeeded in organizing only the necessary data.

Finding the 1500000th Fib Number Using C++

I wrote the following code to find the 1500000th Fibonacci number(Please ignore horrible indenting, I wrote this in about 2 minutes). I need it as a string. Thi

How can ensure that a function only accepts a positive integer?

I want to do some basic validation on a user input in PowerShell to ensure a user can only enter a whole integer and does not enter -7 for example. I am not sur