Posts Tagged conversion

C++ For C# Developers: Part 13 – Initialization

Tags: , , , , ,

With constructors under our belts, we can now talk about initialization of structs and other types. This is a far more complex topic than in C#. Read on to learn a lot of nitty-gritty details!

Read the rest of this article »

4 Comments

From AS3 to C#, Part 8: More Special Functions

Tags: , ,

Today we’ll continue talking about special types of functions in C#. Specifically, today’s article will cover indexers, explicit and implicit conversions, and variable numbers of arguments (“var args”).

Read the rest of this article »

1 Comment

What is an int?

Tags: , , , ,

If you’re thinking “I know what an int is”, you need to take this little quiz to find out for sure!

Read the rest of this article »

6 Comments

Loops With int and uint

Tags: , , , , , , , , ,

AS3 has two integer types: int and uint. In my experience, most AS3 programmers just use int everywhere and ignore uint. This is usually acceptable as the need for unsigned integers is rare compared to their signed counterparts. However, there are significant performance differences between the two. Read on for the impact of uint on your loops. The original version of this article’s performance test contained a small-but-critical error that led to a lot of incorrect analysis and results. This version of the article has been corrected.

Read the rest of this article »

8 Comments

Explicit Type Conversion

Tags: , , , , , , ,

Five months ago I said I’d talked about explicit type conversion. I hadn’t, really. What I talked about before was type casts. A cast changes the type, not the data. Today, I’m actually going to talk about type conversion and show you the costs of converting between all of your favorite types: int, uint, Number, Boolean, String, and even XML.

Read the rest of this article »

4 Comments

Implicit Type Conversion

Tags: , , , , , ,

I’ve talked before about explicit type conversion and used the function-call style (Type(obj)) and the as keyword to accomplish the task. Today, I’m going to talk about implicit type conversion and use—as implicit would imply—no operators at all!

Read the rest of this article »

6 Comments