Send to a Friend

Theotherkid's avatar

Why won't xcode recognize these variables?

Asked by Theotherkid (889points) January 9th, 2010

I’m beginning to learn about C programming, and am trying to add a (character) variable in a standard tool in xcode. Here’s what I wrote:

#include <stdio.h>

int main (int argc, const char * argv[]) {
char exampleofcharacter = ‘J’;
return 0;
}

The variable (char/exampleofcharacter) is supposed to display the “J”, however, when I build the project, I get an error message saying “Unused variable ‘exampleofcharacter’”. There’s probably a very basic solution to this that I’m not understanding.

Using Fluther

or

Using Email

Separate multiple emails with commas.
We’ll only use these emails for this message.