HI Guys

my latest program needs to access an array through a pointer within a struct by using a pointer to that struct itself. im at a loss as to how to do this. i can access non-pointer elements in the same struct (i.e bPtr->digits), i just am unsure how to access the array under my main function from within my ReadBinary function using only pointers. in the ReadBinary function also, after the scanf function has finished the while function is skipped, i beleive becuase the scanf function ends with the newline character. any ideas on how to fix this would also be most welcome. Cheers

Code:
#include <stdio.h>
#include <stdlib.h>

struct BinaryRec
{
	char* aPtr ;
	int digits ;
};
typedef struct BinaryRec Binary ;

void readBinary(/*Binary* bptr*/) ;
//void printBinary(const Binary* bptr) ;

int main()
{
Binary num ;
char array[] ;

Binary* bPtr = (Binary*)malloc(sizeof(Binary)) ;
//num.aPtr = (char*)malloc(num.digits*sizeof(char)) ;

readBinary(bPtr) ;

return 0;
}

void readBinary(Binary* bPtr)
{
char x ;

int i, n ;

printf("Please Enter Number of Binary Digits:") ;
scanf("%d", &n) ;

bPtr->digits = n ;

printf("--%d--\n", bPtr->digits) ;

printf("Please Enter Binary Number:") ;

while((x = getc(stdin)) != '\n')
	{
		if(x != 48 && x != 49)
			{
			printf("\nInvalid Input\n") ;
			exit(1) ;
			}
		else
			{
			/*I Need to access the array at this point by using the pointers aPtr and bPtr to input the characters from getc 	
                       	printf("%c", x) ;
			i++ ;
			}
	}

return ;

}