TweetFollow Us on Twitter

The Road to Code: Pointing the Way

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

The Road to Code: Pointing the Way

Game on!

by Dave Dribin

Welcome Back

Welcome back to The Road to Code. By now, you should be an expert at using simple variables, functions, and mathematical expressions. Even if you're not, you're probably itching to do something more interesting. Well you're in luck. This month we are going to be building a simple game. First, we'll go over three features of the C language: loops, conditional statements, and pointers. We'll look at them individually, and then we'll combine them to build something more complex.

Can You Repeat that, Please?

Sometimes you want to repeat a section of code multiple times. For example, if we wanted to print the numbers from one to five, we could write a simple C program, like this:

Listing 1: main.c Counting to five

#include <stdio.h>
int main(int argc, const char * argv[])
{
   printf("1\n");
   printf("2\n");
   printf("3\n");
   printf("4\n");
   printf("5\n");
   return 0;
}

As an alternative, instead of hard coding the number inside the string, we could use a variable to hold the current number:

Listing 2: main.c Counting with a variable

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

Given the discussion of variables last month, this code should look familiar. However, I did throw one curve ball. I'm using number++, which is just fancy shorthand for number = number + 1. The benefit of using a variable is that if you needed to change your code to count to ten, you could just copy and paste these two lines of code five more times:

   number++;
   printf("%d\n", number);

Although repeating code like this is more flexible than the hard coded strings in Listing 1, it's not without its drawbacks. Copying and pasting is prone to error. You could accidentally paste those two lines six more times, instead of five. You would now have a bug in your program, as it would print until eleven, instead of ten. Luckily, the C language has a solution to help avoid code repetition, called loops.

While Loops

Repeating the same code multiple times is called looping because after executing a block of code, you want it to loop back around to the beginning, as if the computer was running laps around a track. There are a few of different kinds of loops in C, but the first one we'll be looking at is called a while loop. A while loop repeats the same block of code, while a condition remains valid. Here is how we could rewrite our counting program to use a while loop:

Listing 3: main.c Counting with a while loop

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

All while loops have this same basic structure:

   while (condition)
   {
      body
   }

First, you have the keyword while. Next is the condition, in parenthesis. And finally, the body of the loop, enclosed in braces. The body of a loop is very similar to a body of a function: it's a collection of statements that get executed in order. The body of a while loop is executed over and over, so long as the condition of the while loop remains true. Each time through the loop is called an iteration, thus the while loop iterates over the body.

Conditions

The condition, also called a conditional expression, is similar to the mathematic expressions described last month, except that instead of having the computer perform arithmetic, they are a way to ask the computer simple questions. In this case, the <= symbol is called a less than or equal to operator. Thus the expression "number <= 5" is asking the computer "is the variable 'number' less than or equal to five?" The computer responds to this question with a "Yes" or "No" answer. Because the answer is a simple Yes/No value, it is called a Boolean value. Sometimes the "Yes" and "No" values are called "True" and "False," respectively, which is why a Boolean value is also known as a truth value.

That's enough of the fancy computer science terminology for now. What's important is that a while loop keeps executing its body so long as the condition returns true. And in this case, it keeps executing the body so long as the number variable is less than or equal to five. It is important that our body keeps adding one to number. If it didn't, our while condition would always be true, and it would keep printing the same number over and over, forever. When a loop condition is always true, this special case is called an infinite loop. Infinite loops are usually bugs and can cause the program to stop responding normally. When writing your own loops, double-check your code to ensure you are avoiding an infinite loop. As a side bit of trivia, the street address for Apple's headquarters in Cupertino, California is "1 Infinite Loop". Ah... humor only a geek could love.

Using the while loop, if we want to change the program to count to ten, we just have to change the condition at the top of our while loop to:

   while (number <= 10)

That is much less repetition. No more copying and pasting, and we can now count to 100 or even 1,000 very easily. Counting that high would require a lot more work using Listing 1 or Listing 2 as a starting point. As you gain more experience, I think you will notice that reducing repetition is a key to designing programs with fewer bugs.

To finish off the topic of conditions, I'll provide you with a list of a few common conditional operations. You may use the conditional operators found in Table 1 in a similar manner to how we used <= above.

Table 1: Simple Conditional Operators

Operation   C Syntax   
Equals   ==   
Not Equals   !=   
Less Than   <   
Greater Than   >   
Less Than or Equals   <=   
Greater Than or Equals   >=   

For Loops

Another kind of loop is a for loop. Using a for loop, we can rewrite our counting while loop as:

Listing 4: main.c Counting with a for loop

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

This simplifies our while loop by putting the initial value, the check, and the increment all on one line. All for loops have this same basic structure:

   for (initial expression; condition; loop expression)
   {
      body
   }

The initial expression -- in this case, "number = 1" -- is executed before the loop starts. The body of the loop is executed as long as the condition remains true. Finally, the loop expression is executed at the end of every loop iteration. In fact, any for loop can be rewritten as a while loop:

   initial expression
   while (condition)
   {
      body
      loop expression
   }

Because these are equivalent, you should choose a for loop or a while loop based on what makes your code easiest to read and understand. Oh, one final tidbit: when the body of a loop is only a single statement, you can leave off the braces:

int main(int argc, const char * argv[])
{
   int number;
   
   for (number = 1; number <= 5; number++)
      printf("%d\n", number);
   
   return 0;
}

Be careful, though. If you add a second statement, be sure to add those braces back!

Do While Loops

The final loop construct provided by C is called a do/while loop. This is very similar to a while loop, except the body of the loop is always executed at least once. A do/while loop takes the form of:

   do
   {
      body
   }
   while (condition);

The loop now begins with the do keyword, and the condition is moved to the bottom, after the braces. This ensures that the body is executed at least once, because the condition isn't tested until after one iteration of the body. We will be using this in our game program.

Bugs

I've already used the word "bug" a few times in this article, and I'm sure you've heard it before. But what exactly is a bug? The simplest definition is: an error in the program that causes it to not run as intended. "Run as intended" is a rather vague statement, though. Whose intention are we talking about? Take my first example of a bug where I modified the program that counts to five and changed it to count to ten. If I cut and pasted that code one too many times, and it counted to eleven instead, this could be considered a bug. My intention was to write a program that counts to ten, but it counts to eleven! Of course the intention may depend on your end user. If you were Nigel Tufnel of Spinal Tap, going to eleven would be the correct behavior.

There are many, many reasons why programs have bugs. It all boils down to the fact that software is written by humans, and humans make mistakes. There's no way around it. Programs you write will have bugs too. As your programs get larger, the more bugs you will write. If you're going to keep your sanity while writing programs, you're going to have to come to terms with the existence of bugs.

The process of finding and removing bugs is called debugging. Debugging is a large topic in itself, so I won't be talking about it extensively right now.

Making Decisions

Conditional expressions have another important use. You may want to execute a block of code only if a certain condition is true. For example, let's write a program to print every age from one to thirty and whether or not someone that age may vote in the United States:

Listing 5: main.c Printing voting age

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int age;
   
   for (age = 1; age <= 30; age++)
   {
      if (age < 18)
         printf("You may not vote at age %d\n", age);
      else
         printf("You may vote at age %d\n", age);
   }
   
   return 0;
}

Here we are using a for loop to iterate over all ages between one and thirty. Inside the body of the loop, we are using a new construct called an if statement to check the age. Just like a while loop condition, an if statement contains a condition and a body. The body only gets executed when the condition is true. The else statement contains a block that only gets executed when the condition is false. The else statement is optional. If you don't need it, just leave it off. You may also add another if statement onto an else statement:

   if (age < 18)
      printf("You do not have to pay taxes\n");
   else if (age >= 65)
      printf("You may collect social security\n");
   else
      printf("You must pay taxes\n");

And that wraps up loops and conditional statements. Try writing your own program that combines these concepts. For example, try writing a program that prints whether or not someone with a particular age is eligible to drive where you live.

Pointers

Pointers are one of the most important concepts of C, and they are used quite heavily in Objective-C. They are also considered one of the most difficult concepts in C. We'll take it step by step, and in time, I'm sure you'll be able to grasp pointers, as well.

Last month, I used storage boxes as an analogy for variables. For a quick refresher, a variable is like a storage box in that it holds different types of data, such as integer numbers and floating point numbers. However, that analogy goes further. A computer program will have lots of variables, and sometimes a variable with the same name will be used in different functions. How does the computer keep track? Just like the post office uses numbers to keep track of P.O. boxes, the computer uses numbers to keep track of all the variables. It gives each variable a unique number. In fact, this number is also called an address. [Ed. note: for the system administrators in the audience, you can think of this like DNS. People like names, so, we invent a name like www.apple.com. However, computers like numbers, so, we need a way to get the address for www.apple.com, which nslookup and dig will do. You can translate back and forth between name and address.]

The C compiler hides the details of variable addresses because it's easier for people to remember variable names rather than addresses. The compiler provides a way to get the address of a variable, using the address of operator, which is an ampersand character (&). Here is a small program to print out the address of a variable:

Listing 6: main.c Printing an address

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int number;
   number = 5;
   printf("The contents of number: %d\n", number);
   printf("The address of number: %u\n", &number);
   
   return 0;

}

You should get output similar to this in the Run Log window:

The contents of number: 5
The address of number: 3221223788

Your address may be different, but what's important is that every variable has a unique address. Remember from last time that %d in printf formats an integer, which may be positive or negative. %u tells printf that the number is an unsigned, positive only, integer. [1]

You can also declare a variable that holds an address. Our code above could be rewritten as:

Listing 7: main.c Using a pointer

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int number;
   int * pointer;
   number = 5;
   pointer = &number;
   printf("The contents of number: %d\n", number);
   printf("The address of number: %u\n", pointer);
   printf("The address of pointer: %u\n", &pointer);
   
   return 0;
}

If you run this, again you should get output similar to this:

The contents of number: 5
The address of number: 3221223788
The address of pointer: 3221223784

You'll notice that the pointer variable has an asterisk, or star, in front if it. This changes the type of pointer from an "integer" to a "pointer to an integer", which means it holds an address, instead of an actual integer. There are a couple of interesting points about the output. First, the address of number is still the same. Second, the address of pointer is different. Remember, even though pointer holds an address, it, too, is a variable and gets its own address. Thus our program has two variables, or P.O. boxes, which are summarized in Figure 1. Remember, these addresses may be different on your computer, and are essentially arbitrary.


Figure 1: Variables as boxes

Dereferencing Pointers

That said, you rarely print out an address. Pointers are usually used to modify the contents of another variable. For example:

Listing 8: main.c Dereferencing a pointer

#include <stdio.h> int main(int argc, const char * argv[]) { int number; int * pointer; number = 5; pointer = &number; printf("The contents of number: %d\n", number); *pointer = 10; printf("The contents of number: %d\n", number); return 0; }

This will produce output like:

The contents of number: 5
The contents of number: 10

Whoa! What happened there? The contents of the number variable changed, as if we had written:

   number = 10;

Using the star before pointer tells the compiler that we want to change what is at the address of pointer. Let's examine more closely what happens when we use a line of code like "number = 10". The compiler says, "Hmm... I know the number variable has a box with address 3221223788. Let me change the contents of the box at address 3221223788 to 10."

Putting a star in front of pointer is exactly the same thing. Remember that even though pointer has its own address, the contents of pointer is the same address as number: 3221223788. When the compiler sees "*pointer = 10" it says, "The contents of pointer contains the address 3221223788. Let me change the contents of box at address 3221223788 to 10." Using star before a pointer like this is called dereferencing a pointer. Also the star, when used to dereference a pointer, is called the contents of operator.

You can see, now, how pointers get their name. Pointers point to another variable. In this case, the variable pointer points to the variable number. If you're still confused, think of pointers like file aliases on your desktop. When you create an alias in the Finder, the alias points to the original file. If you open the alias, and make changes to it, the original file gets updated, as well. In the same fashion, pointers allow you to alter the contents of another variable.

Passing Pointers to Functions

Is your head spinning, yet? I hope not. Let's run through another scenario where using pointers are helpful. Let's write a function that triples any number that gets passed into it:

Listing 9: main.c Incorrect triple function

#include <stdio.h>
void triple(int n)
{
   n = n * 3;
}
int main(int argc, const char * argv[])
{
   int number;
   number = 5;
   printf("The contents of number: %d\n", number);
   
   triple(number);
   printf("The contents of number: %d\n", number);
   
   return 0;
}

Even though this code may look correct, it actually has a bug in it. If you run it, you will get this output:

The contents of number: 5
The contents of number: 5

Eh? Why is number still 5, you may be asking? It turns out that arguments of functions are also variables. Thus, the argument n of triple has its own address. Calling the triple function copies the contents of number into the contents of n. When triple changes n, it has no effect on number. We can verify this by printing the variable in triple:

void triple(int n)
{
   n = n * 3;
   printf("n in triple: %d\n", n);
}

This produces the output:

The contents of number: 5
n in triple: 15
The contents of number: 5

Okay, well how do fix this? Pointers to the rescue!

Listing 10: main.c Correct triple function with pointers

#include <stdio.h> void triple(int * pointer) { int n = *pointer; n = n * 3; *pointer = n; } int main(int argc, const char * argv[]) { int number; number = 5; printf("The contents of number: %d\n", number); triple(&number); printf("The contents of number: %d\n", number); return 0; }

This time, you should get the correct output:

The contents of number: 5
The contents of number: 15

So what changed here? First, we are using the address of operator (the ampersand) when calling triple:

   triple(&number);

This passes the address of the number variable to triple, instead of making a copy. Now, we have an argument to triple, named pointer, which is a pointer to an integer. When called, this variable points to the number variable in main allowing triple to change the variable in main. Inside triple, it dereferences the pointer, which sets n to five, initially, by looking inside the box of the number variable. Then it multiplies n by three. Finally, we dereference the pointer, again, to put the result, fifteen, back into the original box. This is really no different than our example in Listing 8, except we've now used a pointer as an argument to a function. It's also worth noting that we can shorten the triple function to:

void triple(int * pointer)
{
   *pointer = (*pointer) * 3;
}

This eliminates the temporary variable n and does the modification on one line. I added extra parenthesis on the right hand side to make sure the star for dereferencing the pointer is not confused with a star used for multiplication.

Communicating with the User

Okay, again that was a bit of a contrived example. So when is this useful in your own program? One case is when you want to get input from the user. Here is a simple program to get the user's age using a standard function called scanf:

Listing 11: main.c Asking the user's age

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int age;
   printf("What is your age? ");
   scanf("%d", &age);
   printf("Your age is: %d\n", age);
   
   return 0;
}

This time, when you run the program, it will stop, waiting for you to type your age into the Run Log window. Type it in, and press Return. Here's what I did:

What is your age? 33
Your age is: 33

The first 33 in bold red is what I typed in. On the next line, you can see it printed my age back to me. What happened here? scanf is a function that reads user input, but it needs to store this result somewhere. By using a pointer, we can pass the address of the age variable, and scanf can store the user's response in age. The %d here is similar to a %d used in printf, and tells scanf to read an integer from the user.

Now that we can communicate with the user, it's getting interesting. Just to spice this up, let's add an if statement that tells you if you are allowed to vote in the United States, similar to what we did in Listing 5:

Listing 12: main.c Can the user vote?

#include <stdio.h>
int main(int argc, const char * argv[])
{
   int age;
   printf("What is your age? ");
   scanf("%d", &age);
   printf("Your age is: %d\n", age);
   if (age >= 18)
      printf("You are allowed (and should!) vote\n");
   else
      printf("Sorry, you are not allowed to vote, yet\n");
   
   return 0;
}

Try running this a couple times, first using an age greater than or equal to eighteen, and again using an age less than eighteen.

Putting it All Together

Lying about your age isn't all that fun, so let's put it all together by writing a simple number guessing game. Here's the code to the entire game:

Listing 13: main.c    Number guessing game
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
// Generate a random number between 1 and 32
int generate_random_number(void)
{
   // "Seed" the random number generator
   srand(time(NULL));
   int random_number = rand();
   return (random_number % 32) + 1;
}
void play_game(void)
{
   int random_number;
   int guess;
   int count;
   
   random_number = generate_random_number();
   count = 0;
   printf("I am thinking of a number between 1 and 32.\n");
   printf("How quickly can you guess it?\n");
   do
   {
      printf("What is your guess? ");
      scanf("%d", &guess);
      if (guess < random_number)
         printf("You guessed too low. Try again.\n");
      else if (guess > random_number)
         printf("You guessed too high. Try again.\n");
      count++;
         
   } while (guess != random_number);
   printf("You guessed it correctly!\n");
   printf("It only took you %d guesses.\n", count);
}
int main(int argc, const char * argv[])
{
   play_game();
   
   return 0;
}

Hopefully there are not too many surprises here. The only part we have not covered is generating a random number. The rand function is supposed to generate a random number between zero and 2147483647. However, there is one gotcha. If you don't seed the random number generator, it will always return the same sequence of numbers. Since this would not make a very fun game, we are using the current time as a seed. If you don't understand this, don't worry. Just trust me that it's necessary to make this game fun.

Okay, so rand gives us a number between zero and 2147483647, but we really want a number between one and thirty-two. The percent sign is a mathematical operator called the modulo operator that returns the remainder of a division. Think back to grade school math and remember that when dividing a number, you get a quotient and a remainder. For example, if you divide 53 by 10, the quotient is 5 and the remainder is 3. A fancy name for doing division and returning the remainder is called taking the modulo of a number, or just mod for short. The nice thing about the modulo is that its value is always between zero and the divisor minus one. Thus the expression (random_number % 32) always returns a number between zero and thirty-one. Since we want a number between one and thirty-two, we need to add one to it.

Phew! Creating a random number was a little complicated, but given your new knowledge of loops, conditional statements, and pointers, you should be able to understand the rest of the program. The play_game function keeps asking the user for a guess and only stops if the user guesses correctly. It also gives a little hint to the user so she or he can refine their guess. We added two more #include statements, because we are now using other functions that are not declared in stdio.h. rand and srand are declared in stdlib.h, and time is declared in time.h.

Here is a sample session of a game.

I am thinking of a number between 1 and 32.
How quickly can you guess it?
What is your guess? 16
You guessed too low. Try again.
What is your guess? 24
You guessed too high. Try again.
What is your guess? 20
You guessed too low. Try again.
What is your guess? 22
You guessed it correctly!
It only took you 4 guesses.

Play the game yourself a few times, and see how well you can do. With the correct strategy, you should always be able to guess correctly in five guesses or less. Read over the code again, and see if you can follow along as you type. Just to make sure you understand, try adding another do/while loop in main that asks the user if they would like to play again. I'll give you a small hint:

   play_game();
   printf("Enter (1) to play again: ");
   scanf("%d", &response);

See if you can figure out the rest!

Conclusion

We covered a lot of ground this month, from loops and conditional statements to pointers. I know pointers can be a bit tricky. If it's still not clear to you, I suggest writing some code, yourself. Pointers can definitely be difficult to understand by reading alone, so dive in and start playing around. Think about it this way: in just two months, you now know how to write a simple game. That's some good stuff. See what you can do on your own with what we've covered. Programming might take some practice, but it can be fun!

Footnotes

[1]: This is technically incorrect. Pointers should use the %p format string, instead of %u. Unfortunately, %p prints the address in hexadecimal, which is an advanced topic we'll cover later.


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

Top Mobile Game Discounts
Every day, we pick out a curated list of the best mobile discounts on the App Store and post them here. This list won't be comprehensive, but it every game on it is recommended. Feel free to check out the coverage we did on them in the links... | Read more »
Price of Glory unleashes its 1.4 Alpha u...
As much as we all probably dislike Maths as a subject, we do have to hand it to geometry for giving us the good old Hexgrid, home of some of the best strategy games. One such example, Price of Glory, has dropped its 1.4 Alpha update, stocked full... | Read more »
The SLC 2025 kicks off this month to cro...
Ever since the Solo Leveling: Arise Championship 2025 was announced, I have been looking forward to it. The promotional clip they released a month or two back showed crowds going absolutely nuts for the previous competitions, so imagine the... | Read more »
Dive into some early Magicpunk fun as Cr...
Excellent news for fans of steampunk and magic; the Precursor Test for Magicpunk MMORPG Crystal of Atlan opens today. This rather fancy way of saying beta test will remain open until March 5th and is available for PC - boo - and Android devices -... | Read more »
Prepare to get your mind melted as Evang...
If you are a fan of sci-fi shooters and incredibly weird, mind-bending anime series, then you are in for a treat, as Goddess of Victory: Nikke is gearing up for its second collaboration with Evangelion. We were also treated to an upcoming... | Read more »
Square Enix gives with one hand and slap...
We have something of a mixed bag coming over from Square Enix HQ today. Two of their mobile games are revelling in life with new events keeping them alive, whilst another has been thrown onto the ever-growing discard pile Square is building. I... | Read more »
Let the world burn as you have some fest...
It is time to leave the world burning once again as you take a much-needed break from that whole “hero” lark and enjoy some celebrations in Genshin Impact. Version 5.4, Moonlight Amidst Dreams, will see you in Inazuma to attend the Mikawa Flower... | Read more »
Full Moon Over the Abyssal Sea lands on...
Aether Gazer has announced its latest major update, and it is one of the loveliest event names I have ever heard. Full Moon Over the Abyssal Sea is an amazing name, and it comes loaded with two side stories, a new S-grade Modifier, and some fancy... | Read more »
Open your own eatery for all the forest...
Very important question; when you read the title Zoo Restaurant, do you also immediately think of running a restaurant in which you cook Zoo animals as the course? I will just assume yes. Anyway, come June 23rd we will all be able to start up our... | Read more »
Crystal of Atlan opens registration for...
Nuverse was prominently featured in the last month for all the wrong reasons with the USA TikTok debacle, but now it is putting all that behind it and preparing for the Crystal of Atlan beta test. Taking place between February 18th and March 5th,... | Read more »

Price Scanner via MacPrices.net

AT&T is offering a 65% discount on the ne...
AT&T is offering the new iPhone 16e for up to 65% off their monthly finance fee with 36-months of service. No trade-in is required. Discount is applied via monthly bill credits over the 36 month... Read more
Use this code to get a free iPhone 13 at Visi...
For a limited time, use code SWEETDEAL to get a free 128GB iPhone 13 Visible, Verizon’s low-cost wireless cell service, Visible. Deal is valid when you purchase the Visible+ annual plan. Free... Read more
M4 Mac minis on sale for $50-$80 off MSRP at...
B&H Photo has M4 Mac minis in stock and on sale right now for $50 to $80 off Apple’s MSRP, each including free 1-2 day shipping to most US addresses: – M4 Mac mini (16GB/256GB): $549, $50 off... Read more
Buy an iPhone 16 at Boost Mobile and get one...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering one year of free Unlimited service with the purchase of any iPhone 16. Purchase the iPhone at standard MSRP, and then choose... Read more
Get an iPhone 15 for only $299 at Boost Mobil...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering the 128GB iPhone 15 for $299.99 including service with their Unlimited Premium plan (50GB of premium data, $60/month), or $20... Read more
Unreal Mobile is offering $100 off any new iP...
Unreal Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering a $100 discount on any new iPhone with service. This includes new iPhone 16 models as well as iPhone 15, 14, 13, and SE... Read more
Apple drops prices on clearance iPhone 14 mod...
With today’s introduction of the new iPhone 16e, Apple has discontinued the iPhone 14, 14 Pro, and SE. In response, Apple has dropped prices on unlocked, Certified Refurbished, iPhone 14 models to a... Read more
B&H has 16-inch M4 Max MacBook Pros on sa...
B&H Photo is offering a $360-$410 discount on new 16-inch MacBook Pros with M4 Max CPUs right now. B&H offers free 1-2 day shipping to most US addresses: – 16″ M4 Max MacBook Pro (36GB/1TB/... Read more
Amazon is offering a $100 discount on the M4...
Amazon has the M4 Pro Mac mini discounted $100 off MSRP right now. Shipping is free. Their price is the lowest currently available for this popular mini: – Mac mini M4 Pro (24GB/512GB): $1299, $100... Read more
B&H continues to offer $150-$220 discount...
B&H Photo has 14-inch M4 MacBook Pros on sale for $150-$220 off MSRP. B&H offers free 1-2 day shipping to most US addresses: – 14″ M4 MacBook Pro (16GB/512GB): $1449, $150 off MSRP – 14″ M4... Read more

Jobs Board

All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.