C programming tutorials

Two Common Mistakes in Floating Point Arithmetic in C

contributed by Vishwanath Dalvi on November 2, 2011 under C programming

This tutorial will demonstrate two rules that must be respected when performing floating point arithmetic in C. Following these rules will prevent loss of information. Examples with walk through explanation provided.

 

Cocoa: Convert number to comma-separated NSString

contributed by qmchenry on January 30, 2010 under C programming

At some point in your Mac, iPhone, or iPad development you may find the need to express a long number (1000000000) as a comma-separated string (1,000,000,000) to make life easier on your users. The NSNumberFormatter class is a rich tool for converting numbers to strings supporting different types of currencies and localizations. It’s also the perfect class to leverage for our comma-ing task.

 

Get Web Page Contents in Code with C#

contributed by johnnythawte on December 27, 2006 under C programming

When you are developing an application that needs to access data stored on a web server, you can easily get the contents of a web page with this simple C# function.

 

Pause Output From a Command Line Application in .NET Debug Mode

contributed by johnnythawte on December 22, 2006 under C programming

If you are writing a command line application in .NET, you might notice that the application closes immediately if you haven’t set a breakpoint. This recipe shows you the one line method to keep the application open so you can see the output.

 

Make System Tray Based Application in .NET

contributed by johnnythawte on December 20, 2006 under C programming

Creating an application that lives in the system tray is easy, but it is not entirely obvious how to do so in Visual Studio. This recipe will show you the steps.

 

Open a URL in the Default Browser in Your .NET Application

contributed by johnnythawte on December 11, 2006 under C programming

Virtually every application these days requires at least some connection to the internet. Letting the user click a link and open it in their browser is essential. This recipe shows you the 1 line method of doing so.

 

Pass Variables to a New Thread in C#

contributed by johnnythawte on December 9, 2006 under C programming

When you create a new thread in .net 1.1, you cannot pass any parameters to the ThreadStart delegate, which makes passing startup variables difficult. This recipe shows you an easy workaround.

 

Load an Icon from an Embedded Resource in .NET

contributed by johnnythawte on under C programming

When you are developing a Windows Forms application in .NET, it’s not immediately obvious how to programatically load an icon file embedded in your executable. This recipe shows you the 1 line solution.