Compare between pointers and integer

I have a question, I tried to copy one line from a pointer to file but there is one error that says that I cannot compare a interger with a pointer, can anyone help me? The error is in line ch = getc(file1); and while(ch != EOF) #include <stdio.h...
more »

2017-06-14 22:06 (1) Answers

Combine integers into factor

I am unsuccesfully trying to combine six integers into a single factor variable with 6 values. So far this is the closest I've come: dt$o_typer <- factor(rep(NA, length(dt$opkvalificering)), levels = c("Sidemandsoplæring","Mento...
more »

2017-06-13 16:06 (0) Answers

append some value to integer array in python

import numpy as np c=[4,8,2,3........] a=np.array([2,3,5],np.int16) #data type=np.int16=Integer(-32768 +32767)) for i in range(len(c)): a.append(c[i]) # This line getting error how can I add some value to this integer array "a" using append...
more »

2017-06-13 06:06 (4) Answers

Converting float to int in C++

I am talking about converting floats that already store integer values (like 10.0) I need to do this because I want to create a simple function that reverses a given integer, and it uses a line of code that looks something like this: ans += x % (int)...
more »

2017-06-12 14:06 (1) Answers

android ble setValue is 0x00010000

I have one function : public static String toPaddedHex(int i) { return String.format("0x%04X", i); } //print System.out.println(toPaddedHex(1)); // 0x0001 if I want print is "0x00010000" what do I do ? ...
more »

2017-06-12 05:06 (1) Answers

Putting integers in order

I have generated 5 random integers and I'm trying to put them in order from smallest to largest. This is on Delphi 2010. I have tried using "if" conditionals, "while" and "repeat" loops. But these are extremely long. And defective, e.g. with the fi...
more »

2017-06-10 09:06 (0) Answers

Converting floats to n-byte binary integer

Given the following base 10 decimals a)3.75 b)0.7 c)89.9 convert a) to integer binary 1 byte, convert b) to integer binary 2 byte, convert c) to integer binary 3 byte. These questions are pretty confusing, but I have a guess as to the solution. a ...
more »

2017-06-10 04:06 (0) Answers

Non-numeric argument to binary operator in R

I'm trying to plot some numbers in a graph, in the line x and y. The problem is I'm formatting the numbers as 3M for 3.000.000, 10k for 10.000, then I'm trying to put these numbers in the graph using the axis function, the problem is that I'm getting...
more »

2017-06-10 02:06 (1) Answers

Extract numbers then sum using regular expressions

I'm trying to extract all the numbers from a text file using re.findall() and compute the sum using a for-loop. What I was getting at first was a list of lists, so I put them in one overall list and tried to convert each number into integers. But the...
more »

2017-06-09 22:06 (1) Answers

No matching member function for call to "erase"

I try to call erase() function to remove whitespaces in string for function that converts string to integer. The same code works in main() but inside function it doesn't.How can I fix it? int convert(const string &line) { for (int i=0;i<line...
more »

2017-06-08 08:06 (2) Answers

How to find a set of three or more number?

Can you please help me find a set of three numbers og more with a sum of X in a given list. Fx a set of tree numbers with a sum of 6 in the list 1,2,3,4,5,6,7,8,9 would be 1+2+3 I can do this with a set of two numbers se VBA code below Function Se...
more »

2017-06-05 10:06 (1) Answers

Convert Non-List Type to List Directly

I have a list of items that I need to actually be a list of lists. All the conversion methods I have seen convert the non-list items to lists of individual characters ["12", "cat", 87] to [['1', '2'], ['c', 'a', 't'], ['8', '7']] instead of [['12'], ...
more »

2017-06-04 19:06 (3) Answers

C - ULL Prefix, Hex

I write a code: int main() { long long a = 1a1b2a2b3a3b4a4b; long *p1; long *p2; long *p3; long *p4; *p1 = 1a1b; *p2 = 2a2b; *p3 = 3a3b; *p4 = 4a4b; *p1 = &p2; *p2 = &p3; *p3 = &p4; p...
more »

2017-06-03 09:06 (2) Answers

list containing integers and strings in python

I am new to Python. Suppose you have python dictionary, where values are lists different elements. These values can contain only integers, only strings or both. I need to find values that contain both strings and integers. This is my solution, which...
more »

2017-06-03 00:06 (1) Answers

C program to convert Decimal to Binary

I've written a program in C to convert Decimal numbers to Binary and store it in a string. The issue is not the binary that's printed in reverse but how the output is displayed #include <stdio.h> #include <string.h> #include <stdlib.h...
more »

2017-06-02 15:06 (2) Answers