Our services: SOFTWARE DEVELOPMENT,  WEB DEVELOPMENT, DATABASE DESIGN and ADMINISTRATION, ENHANCEMENT of EXISTING SOFTWARE, ENHANCEMENT of EXISTING WEB SITES, ENHANCEMENT of EXISTING DATABASE, GRAPHIC DESIGN – LOGOS, BANNERS, ICONS…, PHOTOGRAPHY: SHOOTING PHOTOS, IMPROVING AND RETOUCHING, VIDEO PRODUCTION: RECORDING VIDEOS, CREATE MOVIES, PUBLISHING, SEO – SEARCH ENGINES OPTIMISATION, SOCIAL NETWORKS – POSTS ON TWITTER, GOOGLE+, FACEBOOK, LINKEDIN.

           Search  Search  

Pointers Basics
  More Misc tutorials ... 

  SoftFern.com on Twitter   SoftFern.com on YouTube   SoftFern.com on flickr   SoftFern.com on Pinterest
SoftFern.com on Facebook   SoftFern.com on Google+   SoftFern.com on Tumblr   SoftFern.com on LinkedIn



Our services: SOFTWARE DEVELOPMENT,  WEB DEVELOPMENT, DATABASE DESIGN and ADMINISTRATION, ENHANCEMENT of EXISTING SOFTWARE, ENHANCEMENT of EXISTING WEB SITES, ENHANCEMENT of EXISTING DATABASE, GRAPHIC DESIGN – LOGOS, BANNERS, ICONS…, PHOTOGRAPHY: SHOOTING PHOTOS, IMPROVING AND RETOUCHING, VIDEO PRODUCTION: RECORDING VIDEOS, CREATE MOVIES, PUBLISHING, SEO – SEARCH ENGINES OPTIMISATION, SOCIAL NETWORKS – POSTS ON TWITTER, GOOGLE+, FACEBOOK, LINKEDIN.


Free wallpapers of the hottest girls of the 2014 Winter Olympics

Complete guide for Euro 2012’, about 300 hundred pages filled with comprehensive information about Euro 2012


Euro 12 - teams, managers, players, fixtures, referees, the brand new ‘Tango 12’ Adidas ball and much, much more. Few hundreds amazing photos.


E-books, free e-books, Euro 2012 e-books


Auckland events in photos at bonanz.com


1 500 photos of fun-run 'Ports of Auckland Round the Bays 2012' at bonanz.com


Ocean swim - more than 1 500 photos of State King of the Bays

 

SoftFern.com Forums BonaNZ.com forums

SoftFern.com Forums - articles, news, links 

 

BonaNZ.com Forums - articles, news, links 


Photos of State King of the Bays event at bonanz.com


‘Complete guide for Euro 2012’: Given profile all 368 footballers with their photos.
 
 


‘Complete guide for Euro 2012’: Read about star players of each squad. Find out who is the key player of each team. What Pele expects of Euro 2012?



‘Complete guide for Euro 2012’: Compare annual salary of coaches participating in the Euro-2012 - and how it happened that the team of the most paid coach finished the last in their group?




‘Complete guide for Euro 2012’: Euro 2012 footballers: who are the most expensive players? Who are the Rising stars at Euro 2012?



E-books, free e-books, Euro 2012 e-books
 
  
 Popularity 
 Rating: 3      Rate this article   35 
 15 Apr 2011

Pointers Basics

 







Pointers are variables that hold the addresses of other variables. A simple example is if variable x contains the address of y, then xis said to point to y. Once a pointer points to a variable, the value of the variable can be changed or retrieved through the pointer. Operations carried out through pointers are sometimes referred to as indirection. The general form that a pointer variable declaration takes is:

 type* varname

Here typeis the pointer’s base type, which must be a nonreference type, which means that you can’t declare a pointer to a class object. Note that *must follow the type name. Also, varnameis the name of the pointer variable. To declare a variable var1 to be a pointer to an int, the following declaration is used: int* var1;

A declaration statement, following a type name with a *, creates a pointer type. In C#, the *is distributive and is the declaration. The following declaration declares two variables:

int* var1, var2;

Void Pointers

If you want to declare a pointer but not specify a type for it, it needs to be declared as a void pointer.

void *var1;

Pointer Operators

Let’s take a look at two operators used with pointers — the &and *operators. &is a unary operator used to return the memory address for the operand:

int* var1;

int num = 7;

var1 = #

 

In this example, var1contains the memory address for the variable num. This address will be the location of the variable in the computer’s memory. It’s important to note that this variable has nothing at all to do with the value of the variable num. The operations carried out by &can be thought of as returning the memory address of the operand. The *operator is the compliment of the &operator. It is a unary operator that refers to the value of the variable located at the address specified by the operand.

int var2 = *num;

Here the value of numis placed into the variable var2. *can also be used on the left side of the assignment:

*num = 7:

 

Here the value 7is put into the address for num.


  
  More similar links:

Unsafe Code in C#

Usage of Unsafe Code in C#

How to open documents in Microsoft Visual Studio 2010 on the right of existing Tab.

Drag and drop a file in C# - easy.

How to fix error ‘A potentially dangerous Request.Form…’ – even when ‘ValidateRequest’ set to false.

Sample Credit Card Numbers for Testing Credit Card Functionality

How to copy folder with its permissions?

 
    
 Rate this article from 1 to 5 

      Comments
             
 

11.07.2012    pretty

Heh, it's good to see that you're continuing the trend of asikng "trick" questions in certification, which has to be the dumbest thing I've ever heard. Many MySQL folks complained loudly about the trick questions when they first appeared, but no one

              
        Add comment
Your name:
Your comment:
                      
 Tags: pointers, Pointer Operators, memory, int*
   More Misc tutorials ...
 


  Home page Weird We sell Programming Windows
  News Our Photos Photoshop and Photography SQL server Microsoft Office
  Tech News Our Portfolio iPad Misc Web sites development
  Videos Archive Androids Graphic design Software development
  Auckland and New Zealand About Us Tablet PCs CD/DVD presentation Play games online
  Football Contact us Round the Bays 2012 photos Ocean Swim 2012 photos Auckland Events
  Sport Our Portfolio Stock Images Stock Photos Links Exchange
  Hot Girls Our clients On Twitter Add link Site Map
  Our Twitters’ gadget Site Map Google+ Site Grid Poklonskaya.info
  Health and Beauty Site Grid Pinterest Natalia Poklonskaya.info Soft Fern forums
  Misc News Web pages Facebook Photos, images Hair & Beauty
  On YouTube CD/DVD presentaton Tumblr Daily Motion Flickr
  YouTube - 2 Graphics LinkedIn Live Journal Stumble Upon
  Vimeo - videos Tutorials - Videos Tutorials - Weird Most Popular on Internet Yahts, boats, Tall Ships

SoftFern (New Zealand LTD). 
Design and development by SoftFern 2003 - 2014 Graphics supplied by BonaNZ.com