Simple programs Problem 1: Find the first occurrence of a given character in a character string. Return a pointer to the character if found, NULL otherwise. This problem is solved in the standard library by the strchr function. Let Citeste tot ...
Dimensiune
Introduction to Exception Handling
Introduction to Exception Handling This lesson teaches how to handle exceptions in you C# programs. Our objectives are as follows: Learn what an exception is Implement a routine with a try/catch block Release Citeste tot ...
Dimensiune
Partial types
Partial types 19.1 Partial declarations A new type modifier, partial, is used when defining a type in multiple parts. To ensure compatibility with existing programs, this modifier is different than other modifiers: like get and set, it is no Citeste tot ...
Dimensiune
How to find more information. Overview of lcc-win32’s documentation
How to find more information. Overview of lcc-win32’s documentation The documentation of lcc-win32 comes in four files: · lccdoc.exe. This file contains the following documentation: 1. &n Citeste tot ...
Dimensiune
User interface considerations
User interface considerations There was another way of informing the user that text must be entered: a MessageBox call, telling him/her precisely what is wrong. This alternative, making something explicit with a message, or implicit, like t Citeste tot ...
Dimensiune
Use of Automatically Implemented Properties
Use of Automatically Implemented Properties Oftentimes property accessors (get and set) have trivial implementations and follow the pattern that simply get (return) a private field and set the private field to the value passed. Automatically Citeste tot ...
Dimensiune
Filling the blanks
Filling the blanks Input goes through dialog boxes under windows. They are ubiquitous; so let’s start to fill our skeleton with some flesh. Let’s suppose, for the sake of the example that we want to develop a simple text editor. It should read Citeste tot ...
Dimensiune
Improving the design
Improving the design There are several remarks that can be done about our program. The first one is that the memory allocator could very well fail, when there is no more memory available. When the allocator fails, it returns NULL. Since we neve Citeste tot ...
Dimensiune
Structures and unions
Structures and unions Structures Structures are a contiguous piece of storage that contains several simple types, grouped as a single object.[1] For instance, if we want to handle the two integer positions defined for each pixel in the scree Citeste tot ...
Dimensiune
Variables
Variables Variables represent storage locations. Every variable has a type that determines what values can be stored in the variable. C# is a type-safe language, and the C# compiler guarantees that values stored in variables are always of the a Citeste tot ...
Dimensiune
Expressions, Types, and Variables
Expressions, Types, and Variables This lesson introduces C# expressions, types, and variables. It's goal is to meet the following objectives: Understand what a 'Variable' is. Learn the C# simple types. Obt Citeste tot ...
Dimensiune
Using a DLL
Using a DLL To use our newly developed DLL we just plug-in the older test program we had done for our static library. The interface is the same; nothing has changed from the user code of our library. The only thing that we must do differently i Citeste tot ...
Dimensiune
Newsgroups
Newsgroups Internet newsgroups are a great way of sharing information. There is an lcc newsgroup comp.compilers.lcc. Here is a question that appeared in another interesting newsgroup: comp.std.c that shows an interesting discussion: Citeste tot ...
Dimensiune
Class Inheritance
Class Inheritance This lesson teaches about C# Inheritance. Our objectives are as follows: Implement Base Classes. Implement Derived Classes. Initialize Base Classes from Derived Classes. Learn How to Citeste tot ...
Dimensiune
Path handling
Path handling But let’s continue with our program. It looks solid, and running it with a few files in the current directory works. Let’s try then: H:lccexamples>freq1 '..src77*.c' | more CRASH! What Citeste tot ...
Dimensiune
The dialog box procedure
The dialog box procedure static BOOL CALLBACK DialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) break; case WM_CLOSE: EndDialog(hwndDlg,0); return TRUE; } ret Citeste tot ...
Dimensiune
Interfaces
Interfaces An interface defines a contract. A class or struct that implements an interface must adhere to its contract. An interface may inherit from multiple base interfaces, and a class or struct may implement multiple interfaces. Interfac Citeste tot ...
Dimensiune
Types
Types The types of the C# language are divided into two main categories: Value types and reference types. Both value types and reference types may be generic types, which take one or more type parameters. Type parameters can designate both val Citeste tot ...
Dimensiune
Implicitly Typed Local Variables and Implicitly Typed Arrays
Implicitly Typed Local Variables and Implicitly Typed Arrays The implicit typing of local variables is a general language feature that relieves the programmer from having to specify the type of the variable. Instead, the type is inferred by the Citeste tot ...
Dimensiune
Generics
Generics 19.1 Generic class declarations A generic class declaration is a declaration of a class that requires type arguments to be supplied in order to form actual types. A class declaration can optionally define type parameters: class- Citeste tot ...