[QUOTE=kermit]
Code:
int main( void )
{
int character[10]; /* Initializes character */
printf( "Enter a character: "); /* Asks for character and inputs it */
character = getchar(); // Err... you're trying to change the address of the array here...
This won't work either...
Your confusion regarding arrays and pointers may caome from the fact that the character (without the square brackets and number) actually refers to the address at which the array is stored. character[i] however, would then refer to the ith element of the character array.
However, in any case, Quzah is correct in the sense that you don't need arrays for what this program has to do in the first place.
This code is an example showing how you can use a pointer to store the address of an array, as well as how to access a particular element in the array through a pointer.
Code:
int main(void)
{
int character[10], *pointer;
pointer = character;
pointer[0] = 5;
printf("%d", character[0]);
return 0;
}