TweetFollow Us on Twitter

The Road to Code: Bits and Bytes and Everything Nice

Volume Number: 23 (2007)
Issue Number: 09
Column Tag: The Road to Code

The Road to Code: Bits and Bytes and Everything Nice

More Memory Topics

by Dave Dribin

Memory

Last month in The Road to Code, we went over control statements, such as loops and conditional statements, as well as pointers. This month, we will be going over arrays and dynamic memory. Dynamic memory is used heavily in Objective-C, but I think the concepts are better demonstrated with straight C.

Arrays

A topic that goes hand in hand with pointers is arrays. Arrays are a collection of items of the same type. For example, let's say we want to keep track of the first three even numbers. We could use three separate variables, but that's a little tedious. Fortunately, there's another option. We can use an array, which is a single variable that holds multiple values. For example, see Listing 1.

Listing 1: main.c Simple arrays

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int evens[3];
   evens[0] = 2;
   evens[1] = 4;
   evens[2] = 6;
   
   printf("evens[0] = %d\n", evens[0]);
   printf("evens[1] = %d\n", evens[1]);
   printf("evens[2] = %d\n", evens[2]);
    return 0;
}
When this program is run, you should get the following output:
evens[0] = 2
evens[1] = 4
evens[2] = 6

Digging into this example, the first odd thing you'll notice is the declaration of the evens variable. It starts off like other variable declarations with a type and a name, but after the name you'll see the square brackets with the number three in it: [3]. The square brackets tell the compiler that we are declaring an array of integers, instead of a single integer, and the number inside the brackets is how many items the array may hold. So, in this case, evens is an array that may hold three integers.

The second odd thing is how we are getting and setting the values of the array. Again, we use the square brackets to tell the compiler which item in the array we want to access. The number between the brackets is called an array index. This brings us to the first important bit of information: the first item in the array has an index of 0. Thus, the second item has an index of 1, and the last item has an index of 2. Even though this array has three items, the index ranges from 0 to 2. In fact, the last index of any array is the number of items minus one. It is important to remember this because the C compiler will not remind you. It will happily allow you to accesses index 3 of a three-item array. This kind of bug is very serious, and causes all sorts of trouble. So always be sure to double-check your array indexes!

The nice thing about arrays is that you can make them bigger to hold more items very easily. If we wanted to hold the first five even numbers, we just need to make our array bigger. In order to reduce code repetition, we can use for loops to initialize and print out the array:

Listing 2 main.c Using for loops with an array

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int evens[5];
   int i;
   for (i = 0; i < 5; i++)
      evens[i] = (i+1) * 2;
   
   for (i = 0; i < 5; i++)
      printf("evens[%d] = %d\n", i, evens[i]);
    return 0;
}

This example shows that array indexes may be a variable, instead of a constant number. We are using the variable i to loop over all the indexes of the array. Note the condition of the for loop: i < 5. Using a less than operator ensures i loops from 0 to 4. This code is now more extensible because of the array and for loops. We can easily create an array to hold the first 100 even numbers. But we still have to change the number five in three different places. You may be wondering if we can eliminate this repetition as well, and it turns out that we can.

Preprocessor Macros

In order to reduce this kind of code repetition, the C language has what is called a preprocessor. The preprocessor allows you define macros that perform a search and replace on your code. Let's see how this can help us:

Listing 3: main.c Using a preprocessor macro

#include <stdio.h>
#define ARRAY_SIZE 5
int main(int argc, const char * argv[])
{
   int evens[ARRAY_SIZE];
   int i;
   for (i = 0; i < ARRAY_SIZE; i++)
      evens[i] = (i+1) * 2;
   
   for (i = 0; i < ARRAY_SIZE; i++)
      printf("evens[%d] = %d\n", i, evens[i]);
    return 0;
}

The second line in this program defines a new macro named ARRAY_SIZE. This tells the compiler to replace all uses of ARRAY_SIZE with the number five. The command to define a new macro is #define. Because the first character of this command is the pound character, this kind of macro definition is often called a pound define. While a pound define is very similar to setting a variable, you should not use an equal sign or a semicolon. If we used:

#define ARRAY_SIZE = 5;

Then, the evens declaration would result in invalid C syntax, after the macro replacement:

   int evens[= 5;];

With our new macro in place, changing the array size to ten can be accomplished with one simple change:

#define ARRAY_SIZE 10

Arrays as Pointers

So what's this about arrays and pointers being similar? As it turns out, pointers and arrays can often be used interchangeably in C. A pointer to an integer, int *, can be set to an array without any conversion necessary:

Listing 4: main.c Using pointers and arrays

#include <stdio.h>
#define ARRAY_SIZE 5
int main(int argc, const char * argv[])
{
   int evens[ARRAY_SIZE];
   int * pointer;
   int i;
   for (i = 0; i < ARRAY_SIZE; i++)
      evens[i] = (i+1) * 2;
   
   pointer = evens;
   for (i = 0; i < ARRAY_SIZE; i++)
      printf("pointer[%d] = %d\n", i, pointer[i]);
    return 0;
}

We set the variable pointer to be equal to the array evens without using an ampersand, &, the address of operator, like we did in last month's article. Also, notice that the compiler lets us use an array index on the pointer variable, just like an array. This is because pointers and arrays are virtually the same in C. You do have to be very careful when using pointers as arrays, though. The C compiler does not know that pointer points to an array, instead of an ordinary variable. The compiler simply assumes that if you are trying to access a pointer as an array, you must be right. You can easily introduce subtle and hard to find bugs, so be careful.

If it's so dangerous, why should we use it? In these examples, the sizes of the arrays are set in stone when we compile them. If we want to change the size of the array when the program is running, we have to use pointers as arrays. But before we go over how to do this, we need to take a step back and look under the hood a bit. We need to further understand how computer memory works.

Computer Numbers

Over the last couple of articles, I've been using a box analogy for variables. Each variable is like a box that holds a specific type of data, such as an integer or floating point number. Also, each box is assigned a unique address, which I compared to a P.O. Box number. But real boxes typically hold physical objects like shoes or books. What is a number, and how can a box hold one? Do numbers have certain physical characteristics? It turns out they do, and it all revolves around ones and zeroes.

Internally, computers only understand two digits: 0 and 1. Everything a computer does, from the simple math, to complex graphics and sound all boil down to 0 and 1. So how can computers count higher than 1? It's very similar to normal decimal numbers, where we only have ten digits, 0 through 9. By stringing together multiple digits, we can count much higher than 9, to numbers such as 523. Computers can string together multiple zeros and ones, too, to make larger numbers, such as 1101. Because computers only deal with two digits, instead of the usual ten, these numbers are called binary numbers. Since humans better understand decimal numbers, we need to be able to convert binary numbers, such as 1101, back into normal decimal numbers and vice versa.

To convert binary numbers, we once again have to drudge up some simple math. Normal decimal numbers we use every day are called base-10 numbers because there are 10 digits, 0 through 9. When digits are strung to create a larger number, like 523, each digit carries a certain weight. The base-10 number 523 can be expressed as a simple equation:

52310 = 5x100 + 2x10 + 3x1 = 500 + 20 + 3

The numbers 1, 10, and 100 are the weight of each digit. As we add more digits, the weight goes up by another power of 10 to 1,000, then 10,000, and so on. The small 10 subscript is the mathematical way of clarifying we are talking about a base-10 number. We don't normally include this subscript, as we nearly always deal with base-10 numbers.

Binary numbers work similarly, except there are only two digits available, 0 and 1. To convert a binary number to decimal, we can use base-10 numbers as the weight of each digit. Instead of each weight going up by a power of 10, they go up by a power of 2, i.e. 1, 2, 4, 8, 16, etc. Because binary numbers are based around powers of 2, they are called base-2 numbers and a small 2 subscript may be used to denote a binary number. Thus the 11012 binary number can be converted to 1310 using the power of 2 weights:

11012 = 1x8 + 1x4 + 0x2 + 1x1 = 8 + 4 + 1 = 1310

Because the use of 0 and 1 for the digits of binary numbers, they have been given the shorthand name of bit, which is a contraction of binary digit. Binary numbers are often classified by how many bits they have, thus 11012 is considered a 4-bit number.

Bytes

As we combine more bits together into one binary number, we can start representing larger and larger numbers. When we have a binary number with eight bits, we can represent a number between 0 and 255. This is because the largest 8-bit binary number is 111111112. If we expand this out, using the weight of each digit, we get:

111111112 = 1x128 + 1x64 + 1x32 + 1x16 + 1x8 + 1x4 + 1x2 + 1x1 = 25510

For historic reasons, these 8-bit numbers are the basis of all modern computing and are given a very special name of their own: a byte. Thus a single byte can represent any decimal number from 0 to 255.

Even though we usually let the compiler translate decimal numbers to binary, sometimes you have to deal directly with bits. Unfortunately, binary numbers can be very tedious for people to write out. To make it easier to represent long binary numbers, without converting to decimal, the computer scientists invented a new notation called hexadecimal numbers or just hex for short. Hexadecimal numbers are base-16 numbers that have 16 digits with the weight of each digit being a power of 16. The only problem is that there are not 16 digits available: only 10. Those clever computer scientists decided to borrow the first 6 letters of our alphabet, A through F, to fill in the blanks. Because all of these number conversions can get quite confusing, I've created Table 1 to help convert between binary, hexadecimal, and decimal numbers.

Table 1: Binary, Hexadecimal, Decimal Conversion Chart

Binary Number   Hexadecimal Number   Decimal Number   
              0000                 0                      0   
              0001                 1                      1   
              0010                 2                      2   
              0011                 3                      3   
              0100                 4                      4   
              0101                 5                      5   
              0110                 6                      6   
              0111                 7                      7   
              1000                 8                      8   
              1001                 9                      9   
              1010                 A                      10   
              1011                 B                      11   
              1100                 C                      12   
              1101                 D                      13   
              1110                 E                      14   
              1111                 F                      15   

To convert larger hexadecimal numbers to decimal, we have to resort to power of 16 digit weights. For example, to convert the hexadecimal number 5FC16 to decimal, we first convert each hexadecimal digit to decimal using Table 1, and then use powers of 16 as the digit weights:

5FC16 = 5x256 + 15x16 + 12x1 = 1280 + 240 + 12 = 152310

Using Table 1, we can convert any 4-bit binary number easily to hexadecimal. Converting larger binary numbers to hexadecimal numbers does not even require any math. We just group together 4 bits, and use Table 1 on each group. For example to convert 110110012 to hexadecimal, we first chop it up into 2 groups: 11012 and 10012. Then, converting each group of four, we get D916. If we wanted to convert this number to decimal, we can use the power of 16 weights, again:

110110012 = D916 = 13x16 + 9x1 = 208 + 9 = 21710

This grouping of 4-bits is called a nibble, sometimes spelled nybble. By breaking large binary numbers up into nibbles, it's easy convert them into hexadecimal no matter how many bits you have. With words like bits, bytes, and nibbles, it's easy to see why computer scientists have such a good sense of humor.

Bytes of Memory

How do bits and bytes relate to programming variables? All of the boxes used for the variables in your program are stored in the computer's memory. Your computer's memory, called RAM (short for Random Access Memory) is like the post office, where all P.O. Boxes live. Each box is given a unique number, an address, and each one has the same size. The fundamental size of each box is one byte. But wait... I said earlier that one byte could only hold a number from 0 to 255. So how can an integer variable in C store larger numbers? Well, the C compiler uses multiple, consecutive bytes to create a bigger box. Typically, it uses four bytes, or 32 bits for a variable of type int, which is big enough to hold numbers from 0 to 4,294,967,295. That's just over four billion.

What about negative numbers? Computers steal one bit and use it as the sign of a number. This conversion of negative numbers to binary is called two's complement. I don't have enough space to fully cover two's complement in this article. If you want to learn more, Wikipedia has a good article [1] that is a great place to start. The end result of using two's complement means that int, a signed 32-bit integer, can only hold numbers between -2,147,483,648 and 2,147,483,647. If you need to use larger numbers, and you do not need to use negative numbers, you can use the unsigned int data type when you declare your variables to tell the compiler not to use 1 bit for the sign.

The C compiler has a special operator, called sizeof, that returns the number of bytes a variable or data type uses. This operator works like a function, and you pass a variable or type as the argument. For example, this line of code will print 4:

   printf("%d\n", sizeof(int));

Because all programs have different needs, the C language has other integer data types that are stored using a different number of bytes.

Data Type
sizeof
Largest Signed Value
Smallest Unsigned Value
Largest Unsigned Value
char 1 255 -128 127
short 2 65535 -32768 32767
int 4 4.295x109 -2.147x109 2.147x109
long 4 4.295x109 -2.147x109 2.147x109
long long 8 1.845x1019 -9.223x1018 9.223x1018

Table 2: Standard C Data Types

Table 2 (above) summarizes the standard integer data types and the number of bytes they use on a 32-bit Mac OS X program. By default, these data types are signed. You can use the unsigned keyword in front of any of these types if you only care about positive numbers.

I specifically said "a 32-bit Mac OS X program," because the C language does not make any guarantee of these sizes on other operating systems and processors. For example, on a 64-bit Intel Mac OS X program, sizeof(long) is not four bytes, it's eight. If you really, really care about the number of bytes a variable uses, you should use one of the newer data types. In 1999, signed integer data types of the format intxxx_t, where xxx is a number of bits: 8, 16, 32, or 64 were added. So if you really want a 32-bit signed integer, you would use int32_t. There are also unsigned variants, which use uintxxx_t. So an unsigned 8-bit integer type would be uint8_t. These new types are available in the stdlib.h header file. Listing 6 demonstrates the sizeof operator and these new data types.

Listing 5: main.c demonstrating sizeof

#include <stdio.h>
#include <stdlib.h>
int main(int argc, const char * argv[])
{
   long foo;
   unsigned long bar;
   
   printf("sizeof(foo) = %d\n", sizeof(foo));
   printf("sizeof(bar) = %d\n", sizeof(bar));
   printf("sizeof(uint8_t) = %d\n", sizeof(uint8_t));
   printf("sizeof(uint16_t) = %d\n", sizeof(uint16_t));
   printf("sizeof(uint32_t) = %d\n", sizeof(uint32_t));
   printf("sizeof(uint64_t) = %d\n", sizeof(uint64_t));
   
   return 0;
}

Sizes of Computer Addresses

Most computer processors from the 1980s and 1990s use 32-bit numbers internally for addresses, too. Computer processors are classified by the number of bits used for addresses, thus these processors are classified as 32-bit processors. This means a 32-bit processor only has enough addresses for slightly over four billion bytes of memory, at it's maximum. Since 1 billion bytes, or more precisely 1,073,741,824 bytes, is called a gigabyte, a 32-bit processor is said to address a maximum of four gigabytes. While this may seem like a lot, this may not be enough for some applications.

You may have heard some buzz about "64-bit." In fact, 64-bit Cocoa support is one of the new major features of Leopard. Newer computer processors, like the PowerPC G5 and the Intel Core 2 Duo, can use 64-bit addresses. This allows the computer to access more than four gigabytes of memory, which speeds up some programs that work on large amounts of data, such images, videos, and scientific data.

Dynamic Memory

When you declare a variable inside a function, the compiler automatically sets aside the number of bytes necessary for its storage. This setting aside of memory is called allocating memory. Once the function finishes executing, the allocated memory is automatically given back to the system, called deallocating memory. When the compiler handles memory allocation for you, this is called automatic memory allocation. Because the memory of variables inside a function are allocated and deallocated automatically, they are sometimes referred to as automatic variables.

Sometimes this automatic memory allocation is not good enough, and you have to take matters into your own hands. The standard C library has a function named malloc that allocates the specified number of bytes of memory and returns the address of this new memory. You can assign this address to a pointer, and then use it like we used pointers in last month's article. Because you manually allocated the memory, you must also deallocate it yourself using the free function. When you take control of memory allocation, this is called dynamic memory allocation, or dynamic memory, for short. Listing 8 is a simple example of dynamic memory.

Listing 6: main.c Using dynamic memory

#include <stdio.h>
#include <stdlib.h>
int main(int argc, const char * argv[])
{
   int * pointer;
   pointer = malloc(sizeof(int));
   *pointer = 5;
   printf("*pointer = %d\n", *pointer);
   free(pointer);
   
   return 0;
}

Along with great power comes great responsibility. As such, it's very important to deallocate memory that you allocate. Failing to return memory to the system is called a memory leak. Memory leaks are a serious class of bugs that can affect the performance of your program and the entire system. There are no magic ways to avoid memory leaks in C. You just have to be very careful and make sure you free any memory you allocate with malloc. Memory that is leaked by your application is reclaimed when your application exits. This doesn't mean leaks should be ignored, however. Leaked memory limits the amount of memory available for other tasks, and can slow down the entire system. Objective-C has some techniques to avoid memory leaks, which we will cover in due time.

Dynamic Memory for Arrays

Using dynamic memory, as previously shown in Listing 8, provides no benefit to automatic memory. One real reason to use dynamic memory is when we want to change the size of an array while the program is running. To demonstrate this, let's look at Listing 10, which reads numbers from the user, and prints them in reverse order:

Listing 7: main.c Printing numbers in reverse

#include <stdio.h>
#define MAX_LENGTH 25
void read_numbers(int array[], int length)
{
   int i;
   for (i = 0; i < length; i++)
   {
      printf("Enter number %d: ", i+1);
      scanf("%d", &array[i]);
   }
}
void print_in_reverse(int array[], int length)
 {
   int i;
   for (i = length-1; i >= 0; i--)
   {
      printf("%d\n", array[i]);
   }
}
int main(int argc, const char * argv[])
{
   int numbers[MAX_LENGTH];
   int length;
   
   printf("How many numbers? ");
   scanf("%d", &length);
   if (length < 1)
   {
      printf("Choose a number greater than or equal to 1\n");
      return 1;
   }
   
   if (length > MAX_LENGTH)
   {
      printf("Choose a number less than or equal to %d\n",
            MAX_LENGTH);
      return 1;
   }
   
   read_numbers(numbers, length);
   print_in_reverse(numbers, length);
   return 0;
}

In this program, we have an array of integers, numbers, that has a size of MAX_LENGTH, which is set to twenty-five. The first thing it does is ask the user how many numbers they are going to type in. It does some error checking on this number to make sure it's not too big or too small. Then, it reads that many numbers into the array. Finally, it prints them out in reverse order. I also introduce some new syntax. When arrays are used as arguments to functions, they cannot include a size. Thus, you use square brackets without a number, for example array[].

Here is a sample run of this program:/P>

How many numbers? 4
Enter number 1: 42
Enter number 2: -3
Enter number 3: 523
Enter number 4: 11
11
523
-3
42

Great, it seems to work as designed! Unfortunately, this program has one limitation: the user can only enter twenty-five numbers. What if the user wanted to enter 100, or even 1,000 or 1,000,000 numbers? Sure, we could change MAX_LENGTH, but this is always going to be a guessing game. And if we make MAX_LENGTH very large, then we are wasting memory when the user only wants to enter a few numbers. The solution is to use dynamic memory.

Listing 8: main.c Dynamic size of an array

#include <stdio.h>
#include <stdlib.h>
void read_numbers(int array[], int length)
{
   int i;
   for (i = 0; i < length; i++)
   {
      printf("Enter number %d: ", i+1);
      scanf("%d", &array[i]);
   }
}
void print_in_reverse(int array[], int length)
{
   int i;
   for (i = length-1; i >= 0; i--)
   {
      printf("%d\n", array[i]);
   }
}
int main(int argc, const char * argv[])
{
   int * numbers;
   int length;
   
   printf("How many numbers? ");
   scanf("%d", &length);
   if (length < 1)
   {
      printf("Choose a number greater than or equal to 1\n");
      return 1;
   }
   
   numbers = malloc(length * sizeof(int));
   read_numbers(numbers, length);
   print_in_reverse(numbers, length);
   free(numbers);
   
   return 0;
}

In Listing 8, we changed the type of numbers from an array to a pointer. After getting length from the user, we allocate the needed memory with malloc. Because numbers is now a pointer – and pointers are interchangeable with arrays – we don't have to change the arrays in the function arguments.

The trick for using malloc on arrays is to use the sizeof operator to allocate the correct number of bytes. Remember that each integer uses four bytes of memory. Thus, five integers require twenty bytes of memory. This is why we multiply length by sizeof(int). By using malloc to allocate memory, we've solved two issues. First, the only limit on the size of the array is the amount of memory the user's computer has. We can eliminate the MAX_LENGTH constant and our error checking on the maximum size. Second, we are only allocating memory that we need. We are not wasting memory by only using a portion of a larger array.

This also demonstrates the importance of using the sizeof operator, instead of hard coding the number four. You don't have to remember how many bytes an integer uses. It also makes your program more portable. Because an integer may use a different number of bytes on a different computer, this program will compile on any platform that can compile C. While you may not plan on running your software on a different computer, it's impossible to see the future. Even if you stick to writing only Mac software, Apple has switched processors a number of times, from 68000, to PowerPC, and now Intel. Who knows what Macs will be running on in another ten years?

Conclusion

We've covered a lot of background information in this article. While these examples may seem trivial, the basic concepts they illustrate lie at the heart of Objective-C and programming for Mac OS X. Once we finally get to some "real" Mac programming, our time spent going over all this background information will be time well spent.

Footnotes

[1]: Wikipedia Two's Complement article. http://en.wikipedia.org/wiki/Twos_complement


Dave Dribin has been writing professional software for over eleven years. After five years programming embedded C in the telecom industry and a brief stint riding the Internet bubble, he decided to venture out on his own. Since 2001, he has been providing independent consulting services, and in 2006, he founded Bit Maki, Inc. Find out more at http://www.bitmaki.com/ and http://www.dribin.org/dave/.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Tokkun Studio unveils alpha trailer for...
We are back on the MMORPG news train, and this time it comes from the sort of international developers Tokkun Studio. They are based in France and Japan, so it counts. Anyway, semantics aside, they have released an alpha trailer for the upcoming... | Read more »
Win a host of exclusive in-game Honor of...
To celebrate its latest Jujutsu Kaisen crossover event, Honor of Kings is offering a bounty of login and achievement rewards kicking off the holiday season early. [Read more] | Read more »
Miraibo GO comes out swinging hard as it...
Having just launched what feels like yesterday, Dreamcube Studio is wasting no time adding events to their open-world survival Miraibo GO. Abyssal Souls arrives relatively in time for the spooky season and brings with it horrifying new partners to... | Read more »
Ditch the heavy binders and high price t...
As fun as the real-world equivalent and the very old Game Boy version are, the Pokemon Trading Card games have historically been received poorly on mobile. It is a very strange and confusing trend, but one that The Pokemon Company is determined to... | Read more »
Peace amongst mobile gamers is now shatt...
Some of the crazy folk tales from gaming have undoubtedly come from the EVE universe. Stories of spying, betrayal, and epic battles have entered history, and now the franchise expands as CCP Games launches EVE Galaxy Conquest, a free-to-play 4x... | Read more »
Lord of Nazarick, the turn-based RPG bas...
Crunchyroll and A PLUS JAPAN have just confirmed that Lord of Nazarick, their turn-based RPG based on the popular OVERLORD anime, is now available for iOS and Android. Starting today at 2PM CET, fans can download the game from Google Play and the... | Read more »
Digital Extremes' recent Devstream...
If you are anything like me you are impatiently waiting for Warframe: 1999 whilst simultaneously cursing the fact Excalibur Prime is permanently Vault locked. To keep us fed during our wait, Digital Extremes hosted a Double Devstream to dish out a... | Read more »
The Frozen Canvas adds a splash of colou...
It is time to grab your gloves and layer up, as Torchlight: Infinite is diving into the frozen tundra in its sixth season. The Frozen Canvas is a colourful new update that brings a stylish flair to the Netherrealm and puts creativity in the... | Read more »
Back When AOL WAS the Internet – The Tou...
In Episode 606 of The TouchArcade Show we kick things off talking about my plans for this weekend, which has resulted in this week’s show being a bit shorter than normal. We also go over some more updates on our Patreon situation, which has been... | Read more »
Creative Assembly's latest mobile p...
The Total War series has been slowly trickling onto mobile, which is a fantastic thing because most, if not all, of them are incredibly great fun. Creative Assembly's latest to get the Feral Interactive treatment into portable form is Total War:... | Read more »

Price Scanner via MacPrices.net

Early Black Friday Deal: Apple’s newly upgrad...
Amazon has Apple 13″ MacBook Airs with M2 CPUs and 16GB of RAM on early Black Friday sale for $200 off MSRP, only $799. Their prices are the lowest currently available for these newly upgraded 13″ M2... Read more
13-inch 8GB M2 MacBook Airs for $749, $250 of...
Best Buy has Apple 13″ MacBook Airs with M2 CPUs and 8GB of RAM in stock and on sale on their online store for $250 off MSRP. Prices start at $749. Their prices are the lowest currently available for... Read more
Amazon is offering an early Black Friday $100...
Amazon is offering early Black Friday discounts on Apple’s new 2024 WiFi iPad minis ranging up to $100 off MSRP, each with free shipping. These are the lowest prices available for new minis anywhere... Read more
Price Drop! Clearance 14-inch M3 MacBook Pros...
Best Buy is offering a $500 discount on clearance 14″ M3 MacBook Pros on their online store this week with prices available starting at only $1099. Prices valid for online orders only, in-store... Read more
Apple AirPods Pro with USB-C on early Black F...
A couple of Apple retailers are offering $70 (28%) discounts on Apple’s AirPods Pro with USB-C (and hearing aid capabilities) this weekend. These are early AirPods Black Friday discounts if you’re... Read more
Price drop! 13-inch M3 MacBook Airs now avail...
With yesterday’s across-the-board MacBook Air upgrade to 16GB of RAM standard, Apple has dropped prices on clearance 13″ 8GB M3 MacBook Airs, Certified Refurbished, to a new low starting at only $829... Read more
Price drop! Apple 15-inch M3 MacBook Airs now...
With yesterday’s release of 15-inch M3 MacBook Airs with 16GB of RAM standard, Apple has dropped prices on clearance Certified Refurbished 15″ 8GB M3 MacBook Airs to a new low starting at only $999.... Read more
Apple has clearance 15-inch M2 MacBook Airs a...
Apple has clearance, Certified Refurbished, 15″ M2 MacBook Airs now available starting at $929 and ranging up to $410 off original MSRP. These are the cheapest 15″ MacBook Airs for sale today at... Read more
Apple drops prices on 13-inch M2 MacBook Airs...
Apple has dropped prices on 13″ M2 MacBook Airs to a new low of only $749 in their Certified Refurbished store. These are the cheapest M2-powered MacBooks for sale at Apple. Apple’s one-year warranty... Read more
Clearance 13-inch M1 MacBook Airs available a...
Apple has clearance 13″ M1 MacBook Airs, Certified Refurbished, now available for $679 for 8-Core CPU/7-Core GPU/256GB models. Apple’s one-year warranty is included, shipping is free, and each... Read more

Jobs Board

Seasonal Cashier - *Apple* Blossom Mall - J...
Seasonal Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Seasonal Fine Jewelry Commission Associate -...
…Fine Jewelry Commission Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) Read more
Seasonal Operations Associate - *Apple* Blo...
Seasonal Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Read more
Hair Stylist - *Apple* Blossom Mall - JCPen...
Hair Stylist - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.