Programming

Structures in C/C++

by Shabbir on August 11, 2008

in C/C++

Structures are a group of data elements, and we can access them using the structures. The data elements can be from any types. Sample of a structure struct StructName { int i; char c; } obj1, obj2; So, a structure is declared with the “struct” keyword, then comes its name. Then, in the braces we [...]

{ 2 comments }

Get Visitor IP Address

by Shabbir on July 28, 2008

in PHP

This tutorial will be explained in PHP. In some of the next tutorials we will explain how to do this in ASP.Net. So, this is so easy to do, watch this <?php $ip=$_SERVER[’REMOTE_ADDR’]; echo $ip; ?> Put this code in some HTML page. When the user opens that page, the command echo will write its [...]

{ 4 comments }

Functions in C++

by Shabbir on July 14, 2008

in C/C++

Functions are pieces of code, that can be executed by calling from another function. You know that a common C++ application, must have one function, that functions is int main(). So there is a statement of a function return_type function_name(parameter1, parameter2,…) { // Statements } return_type, is the type that the function returns as a [...]

{ 0 comments }

Read From File In C++

by Shabbir on June 7, 2008

in C/C++

In the previous tutorial we explained how to do that in C#, now we will do that in C++. So, create a Win32 C++ Console Application. This tutorial will be similar to the tutorial for writing to file in c++, So, write this code   int main() { ifstream in; in.open("text.txt");   char line[256];   [...]

{ 1 comment }

In this post we explained how to write text to a file in C#. Today we will explain reading text from a file using the StreamReader class. So create a file “text.txt” in the same directory where is the executable of the project. We will create a C# Console Application. First, we must include this [...]

{ 4 comments }

Using the Timer Class

by Shabbir on May 22, 2008

in C#

The timer class is often used in many applications. It’s very simple for using, like all the classes implemented in .Net Framework. So create a C# Console project, we will try this class in a console application. Include this namespace, so we can use the Timer class using System.Timers; Then in the Main() function put [...]

{ 0 comments }

Trigraph is a sequence of three characters. The first two always are question marks “??”. Trigraphs are equivalent to some single characters. Here is a table from trigraphs and their equivalents Trigraph Equivalent ??! | ??< { ??> } ??/ \ ??’ ^ ??- ~ ??= # ??( [ ??) ] This can cause some [...]

{ 0 comments }

Adding items to list view is more difficult than adding items to list box. And in general the ListView control is more complex than the ListBox, and that makes it more difficult to work with. So, in a C# project, create this form The controls have the default names in Visual Studio 2008. Than click [...]

{ 0 comments }

Remove Unused Using Statements

by Shabbir on May 12, 2008

in C#

When we create a new C#.Net project (or other .Net project, , the editor includes the following using statements in the code using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; But most of this included namespaces are unused, and you don’t know which of them you don’t [...]

{ 2 comments }

Adding items to this controls in .Net is very easy. To demonstrate that we will create a simple project with the following controls: ListBox (name: listBox1) ComboBox (name: comboBox1) TextBox (name: textBox1) Button (text: Add) So, drag this controls from the toolbox and drop them on the main form one by one. Make a form [...]

{ 0 comments }

Usage Of RegistryKey Class

by Shabbir on May 8, 2008

in C#

The usage of RegistryKey class is very huge in many applications in which is needed to “remember” some settings of the application, and then load them when starting the application. Today we will use the RegistryKey class for that issue. The application will save this informations in the registry when exiting: Left Top Height Width [...]

{ 2 comments }

Pointers and Arrays

by Shabbir on May 6, 2008

in C/C++

In this article we will explain moving the pointer through an array. It’s simple but sometimes confusing. So try these simple examples in your unmanaged C++ project. Creating an array and assigning a pointer to it int arr[4]; int *ptr = arr; //[*][ ][ ][ ] Points at the first element of the array When [...]

{ 0 comments }

Read/Write Registry Keys

by Shabbir on May 5, 2008

in C#

Writing and reading to/from a registry key in .Net is really easy. All that is implemented in Microsoft.Win32 namespace, so at the start put this in the usings using Microsoft.Win32; Than in some function write this RegistryKey key = Registry.CurrentUser.OpenSubKey("Software", true) .CreateSubKey("CodeItWell.com"); So, we are creating an object from the RegistryKey class, the object will [...]

{ 4 comments }

Pointers

by Shabbir on May 3, 2008

in C/C++

Pointers are one of the hardest parts of programming to understand. But they are very useful. When programming with pointers, we use two operators: reference operator (&) and dereference operator (*). We use the reference operator to see the address where a variable is stored, and the dereference operator is to see the value of [...]

{ 0 comments }

In the previous two articles (1, 2) we explained connecting to Microsoft Access database and writing to it, in C#. Now we do that in ASP.Net. For start create a new ASP.Net project. First of all we are creating two labels, two text boxes and one button with the following code (add it between the [...]

{ 7 comments }

    About the Author

  • author photo

    My Name is Shabbir Bhimani and I am developer by profession in the field of applications, web and database. Currently doing full time online marketing and like to share my experiences on how you can make money online @ CodeItWell.com. Read more ...


    See how you can get in touch with me.