I'm currently working on Credit. I'm trying to find the first two digits of the card number using a for loop. I've created an array named firstdigits with two elements. Then I've created a for loop to assign the first two digits of the card number to the first and second elements of the array, respectively. However I keep getting an error message indicating the lines firstdigits[0] = card[z]; and firstdigits[1] = card[z]; which says 'subscripted value is not an array, pointer, or vector.' Could someone help, please?
#include <cs50.h>
#include <stdio.h>
#include <string.h>
int main(void)
{
long long card = get_long_long();
int firstdigits[1];
for (int z = 0; z < 2; z++)
{
if (z == 0)
{
firstdigits[0] = card[z];
}
if (z == 1)
{
firstdigits[1] = card[z];
}
}