| Recent Articles | Moving C Structures into .NET with Custom Marshaling In a world where legacy languages often prevail, we are reluctant to move away from them by reciting the well known mantra, "If it ain't broken, don't fix it". This mantra only gets you so far... |
|
| 03.24.05
Event Handling in C#: Custom event Handlers in .NET Made Simple To illustrate event handling we will make a news service that notifies its subscribers whenever an event (new news) occurs. Subscribers can unsubscribe and subscribe at will.
The delegate:
The delegate lets the subscriber know what type method can be notified. Essentially, the news service says “In case of an event occurring, I’ll notify any registered method so long as it has the same signature as the delegate” and the subscriber says, “Okay, register this method.” The method could be in any class. Read The Whole Article
Using Unsafe Code in C# C# .NET hides most of memory management, which makes it much easier for the developer. Thanks for the Garbage Collector and the use of references. But to make the language powerful enough in some cases in which we need direct access to the memory, unsafe code was added.
In the first part of this article I will go throw why (also not) and how to use unsafe code which is mostly about pointers. The second part I will go more deep in pointers, and I will provide examples about where to use them. Read The Whole Article
More on Handling Basic Data Types Have you ever wanted to learn how basic types of C++ variables interact in complex situations? Ivor Horton explains this, and also describes some interesting features of C++. This article is from chapter 3 of Ivor Horton's Beginning ANSC C++ The Complete Language (Apress, 2004; ISBN 1590592271).
IN THIS CHAPTER, I expand on the types that I discussed in the previous chapter and explain how variables of the basic types interact in more complicated situations. I also introduce some new features of C++ and discuss some of the ways that these are used. Read The Whole Article
Secure Cooking with C and C++ In this first in a three-part series of sample recipes from Secure Programming Cookbook for C and C++, the authors offer nine basic rules for proper data validation, which they recommend all programmers should follow. From their first rule: "Assume all input is guilty until proven otherwise" to their last: "The better you understand the data, the better you can filter it," the advice presented here will help programmers keep unwanted, malicious data out of their applications. Read The Whole Article |