Size of an Array How much space in memory does an array occupy? We can calculate this by using a special operator: sizeof. This operator calculates how many bytes of memory are occupied by an array. For example, here is an array: numbers[3] = { 8, 29, 63 }; Using sizeof, I can write: printf(“The numbers array […]
Author Archives: Michael Boguslavskiy
Programming In C: Array of Arrays
Array of Arrays If you have several arrays, you can combine them into an array of arrays. This is a large array that consists of two or more small arrays. For example, let’s say I have two arrays, each with three elements: first[3] = { 11, 17, 23 }; second[3] = { 46, 68, 82 }; […]
Programming In C: Arrays and Loops
Arrays and Loops If you need to perform a function on each element in an array, then use a for loop. Set the counter at 0, so that the loop will start with the array element in index 0, and then loop through each element of the array: for(i = 0; i < number of elements; […]
Programming In C: Initializing Arrays & Isolating Elements
Initializing an Array An array is a set (group) of numbers. (C does not allow for arrays of characters or strings. Use Perl for these.) Here is a sample array: int years[3] = { 1800, 1900, 2000 }; This array is a set (group) of three years: 1800, 1900, and 2000. Each of these is called […]
Bravenet Redesign
Spring cleaning is the period in spring time set aside for cleaning a house, normally applied in climates with a cold winter. The most common usage of spring cleaning refers to the yearly act of cleaning a house from top to bottom which would take place in the first warm days of the year typically […]
New Project: Party Guide NYC
I know it’s been quiet the past few days – I have been working on a new project for Chillstrong called Party Guide NYC (http://www.partyguidenyc.com). The website is aimed at providing a quick and easy way for people to plan their birthday party or event at some of thehottest venues in NYC. Party Guide NYC […]
5 Social Media Tools for your Business
Which social-media sites are best for your business? It depends on your company size, your industry, and your social-media goals. It also depends on what type of social networking you enjoy and will persist in doing. Major social-media sites can be a great place to find customers due to their large user bases, but it […]
Netflix.com Redesigns Their “Watch Instantly” Section
As Engadget properly noticed Netflix.com has redesigned their “Watch Instantly” section – making use of some of the latest features HTML5 makes available. To quote the Netflix Blog: “The title images are larger, there are more of them on the page and play buttons appear when you hover your mouse over the title images. Star […]
HTML Image Maps
An image map is a graphic that has more than one hyperlink attached to it. They hyperlink that the viewer will follow when clicking on the image depends on which part of they click on. To create an image map for a graphic, open it up in PhotoShop, PaintShopPro , or any other rastor based […]
Programming In C: Infinite and Nested Loops
Infinite Loops If you want the viewer to decide when to exit a loop, use an infinite for loop. The infinite for loop sets no requirements inside the for statement, like this: for( ; ; ) Many people shop online, using the internet. Here is a program to help you keep track of how much money […]
Programming In C: For Loops, Numbers and Pictures
Listing numbers We can use for loops to perform various automated tasks. For example, if you want to list a set of numbers on the screen, simply use a for loop and the %d format specifier.
Programming In C: Introducing For Loops
A for loop repeats a function for a specific number of times. Increment and decrement For loops use increment and decrement operators. increment means to loop again, counting up (1, 2, 3, 4, …) The symbol for increment is++ decrement means to loop again, counting down (… 4, 3, 2, 1) The symbol for decrement is —
Programming In C: While Loops
While Loops A while loop repeats a function until a condition is met. Simple while loops Have you ever kept repeating a question until someone gives you the correct answer? (Teachers do this all the time.) This is called a while loop. For example, let’s ask the viewer what year C was developed. The correct answer is […]
Programming In C: Multiple Conditions
Switch (Multiple Conditions) A switch is a function that handles multiple conditions and gives a different response to each condition. It is a very complex type of conditional. Switch If you ask a question that could have several different answers, and you want to give a different response to each answer, then you must use a switch.
Programming In C: Special Conditional Operators
Special Operators (Logical and Conditional) An operator is a function that performs a mathematical calculation, such as addition, or a logical calculation, such as or. Logical Operators In complex conditionals, we use logical operators to test whether multiple conditions are true or false. Here is a list of logical operators: && || ! and or not […]
Programming In C: Simple and Nested Conditionals
Simple Conditional, Nested Conditional A conditional is an if … else statement. For example: If you study, then you will succeed, or else you will fail. This example has three parts: the condition: If you study, if the condition is met: then you will succeed, if the condition is not met: or else you will fail. Notice that […]
Programming in C: Variables and Strings
Characters and Strings A character is a single letter, symbol, or number (from -128 to +127). The value of the character is stored in one byte of memory, so it must be very small. A string, however, can be any length of letters, words, or symbols, like a name or a sentence. Let’s learn how to handle […]
Programming in C: Short and Long Variables
Short and Long Integers, Double and Long Double Floating Points C provides special integer and floating point variables to handle short and long numbers. How you use these depends on how your computer’s memory stores information. Short and Long Integers When declaring an integer, you can use one of three variable types: Type int […]
Programming in C: Floating Point Variables
Floating Point Variables, Working with Money, Viewer Input with Float, Constants Now that we understand integer varialbes, let’s learn about another type of number: the floating point. Floating Point Variables A floating point variable is a number with a decimal point value, like 5.34 or -345.98.
Programming in C: Working With Variables
Declaring Variables, Integers, Working with Viewer Input, and Arithmetic Operators A variable stores information. In C, we use different types of variables to store different types of information, such as numbers, letters, or words. The variable holds the information until you are ready to use it. Declaring (Initializing) Variables Whenever you use a variable in a […]