Is there any reason to prefer static_cast<> over C style casting? Are they equivalent? Is there any sort of speed difference? 7 Answers 7
Using PHP, what’s the fastest way to convert a string like this: "123" to an integer? Why is that particular method the fastest? What happens if it gets unexpected...
How does one handle type casting in TypeScript or Javascript? Say I have the following TypeScript code: module Symbology { export class SymbolFactory { createStyle( symbolInfo : SymbolInfo) :...
How do I cast an int to an enum in C++? For example: enum Test { A, B }; int a = 1; How do I convert a to...
I know it’s possible to cast a list of items from one type to another (given that your object has a public static explicit operator method to do the...
For this code block: int num = 5; int denom = 7; double d = num / denom; the value of d is 0.0. It can be forced to...
For example, lets say you have two classes: public class TestA {} public class TestB extends TestA{} I have a method that returns a List<TestA> and I would like...
This is a silly question, but you can use this code to check if something is a particular type… if (child is IContainer) { //.... Is there a more...
How can I convert a String such as "12.34" to a double in Java? 14 Answers 14
I have a script which reads a text file, pulls decimal numbers out of it as strings and places them into a list. So I have this list: my_list...