C Programming with Pointers

What is a pointer?

A pointer is commonly known as a reference to a location in memory. You can use it to locate a section of memory that you forgot the variable too or you can use it to exchange data between two locations in memory.

How do we declare a pointer value?

To declare a pointer value all one must do is place an asterisk between the data type and the identifier of a variable; like so.

Woa! Hold up, what is that & sign there for? The & sign is specified as an Address Operator which goes and gets the address in memory of integer a and returns it to the pointerA variable. The result of this program if you printed out what a and pointerA equals on my machine it will come up with:

image

That was cool. Now you know how to create a pointer, and how to assign an address to it.

Tip: If you are assigning an pointer to an array you do not need the asterisk because the array’s identifier already points to the address of the array.

How do I get a value from a pointer? Simple just place an asterisk in front of the identifier you are trying to get. You can read this as “The Value of” such as in the context below… Just append the line of code underneath to your file in the scope of main.

Me reading the above line out loud:

“Print the value at pointer A to the console.” – Taylor Brazelton

Now you realize the point of pointers in C and C++ hopefully you aren’t summoned upon to use these skills but every now and then someone is. Enjoy the tutorial and use it to your benefit.

Sneak peak at WP7 Control PC Application!

Recently since the new release of the WP7 development tools into their final stage, I have been working on an application with permission from the owner and supreme of the TweetMyPC Team over at Codeplex. I can’t tell you much about it yet, but I am very proud of the application, so check out the pre-release screenshots below.

image

image

image

Open URL with out Clicking the Web Browser Button.

Today while putting iTunes in my taskbar as a toolbar, I noticed an setting called Address and though I’d try it. What Address does is add’s a simple URL type box to your taskbar. Say you want to go to bing.com just type it into the textbox and press enter and BAM! It opens the webpage in a currently opened broswer or if you don’t have one open it just starts a new task for your browser and ta-da!

To enable this feature on your computer all you have to do is go down, left, right, or even to the top of your screen(where ever your taskbar is) and right click then select Toolbars>Address and ta-da!

Enjoy!