皇冠hg0088代理网址

Questions tagged [casting]

Casting is a process where an object type is explicitly converted into another type if the conversion is allowed. This process might lead to a change in value.

Filter by
Sorted by
Tagged with
0
votes
2answers
37 views

How to cast from `std::vector<uint8_t>` to `std::vector<int8_t>`?

I need to fill data into SetByteArrayRegion: void JNIEnv::SetByteArrayRegion(jbyteArray array, jsize start, jsize len, const jbyte *buf) where jbyte is simply int8_t. I have a vector of uint8_t. Why ...
0
votes
0answers
21 views

Choose a function at run time using overloaded resolution in C++

I have a method of a class (bar from app in the example below). I want with method to call automatically, I mean without conditional statement like if, overloaded functions (create in the example). ...
0
votes
0answers
11 views

TypeScript: why I cannot remove this type assertion?

Why this piece of code won't compile? interface TaggedProduct { tag: string; } interface Product { tag?: string; } const tagProduct = (product: Product): TaggedProduct => { const tag: ...
0
votes
2answers
39 views

Extracting Bits and Shifting

I don't understand why the following code output is 0xffffffef,... instead of 0xef. Kindly help me understand this: #include <stdio.h> main() { int i; int n = 4; char txBuff = 0; ...
1
vote
0answers
10 views

How to make 5.1 dolby digital audio work in chromecast from exoplayer

I hope someone can help me with this problem. When I use the shakaplayer demo (http://v2-4-7-dot-shaka-player-demo.appspot.com/demo/#build=uncompiled), and in Configuration-> Preferred audio ...
0
votes
1answer
42 views

C++ program compiles in Visual Studio 2010 but not Mingw

The program below compiles in VS 2010, but not in a recent version of Mingw. Mingw gives me the error "conversion from int to non-scalar type 'tempClass(it)' requested". Class "it" ...
0
votes
0answers
27 views

Reinterpret char[] as object with fields

I get as an argument data which is of type char[]. Given the information data is organized as a Packet object. How do I convert data to be a Packet? Packet includes primitive fields, and array of ...
-4
votes
0answers
37 views

How is C#'s “is” operator implemented? [duplicate]

What algorithm is used to implement C#'s is operator? I'm aware of the isinst IL instruction, but I'm interested in how that works. Checking for an exact type match should be simple enough, using the ...
2
votes
2answers
25 views

PHP JSON API - detect data types of return values

im working on a PHP JSON API which returnes json_encoded multidimensional arrays. Due to the fact, that PHP is a weak typed language - i have some problems with the returned data types on the client ...
0
votes
1answer
36 views

Is this valid typecasting use with array of structs?

In the past I've struggled with understanding pointer arithmetic, typecasting and array of structs, and sometimes even if the program works, it's still technically incorrect, so I just wanted to run ...
-1
votes
0answers
34 views

Convert string to checkbox in C # [closed]

I want to attach the value of the datagridview cells equal to "true" to my checkboxes. I created a loop that connects the column and the checkbox, respectively *The name of the checkbox with ...
0
votes
2answers
32 views

SQL View returning different results when selected database different

a weird one. In troubleshooting why a view returns different results when run from different databases in SQLMS, I've pealed it back to this: select cast((cast(0.31 as numeric(18,2)) - cast(0.31 as ...
0
votes
2answers
41 views

CAST(VARCHAR2 AS NUMERIC) with “.” in the VARCHAR

I have a problem when converting VARCHAR2 to Number in Oracle SQL. My VARCHAR2 has the following characteristic: 0.000 For example: the value of Campo1 is 18.123 (with a .) But I get an error: 00000 -...
0
votes
1answer
44 views

Assign a small number to unsigned long long data-type without casting

I became a little bit confuse about assigning a small number to a big data-type variable, for example in my code (checkout online) : #include <iostream> int main() { unsigned long long num = ...
9
votes
1answer
53 views

I need to change the type of few columns in a pandas dataframe. Can't do so using iloc

In a dataframe with around 40+ columns I am trying to change dtype for first 27 columns from float to int by using iloc: df1.iloc[:,0:27]=df1.iloc[:,0:27].astype('int') However, it's not working. I'm ...

15 30 50 per page
1
2 3 4 5
1161