c - problem with headers?

I have a simple program to create a poker deck, shuffle it and deal cards. Here it is:

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

struct Card {
    char *face,
         *suit;
    };

void fillDeck (Card *deck, char *face[], char *suit[]);
void shuffle (Card *deck);
void deal (Card *deck);

int main ()
{
  struct Card deck [52];

  char *face [13] = {"Ace", "Deuce", "Tree", "Four", "Five",
                     "Six", "Seven", "Eight", "Nine", "Ten",
                     "Jack", "Queen", "King"},
       *suit [4] = {"Hearts", "Spades", "Diamonds", "Clubs"};

  srand (time (0));
  fillDeck (deck, face, suit);
  shuffle (deck);
  deal (deck);
  return 0;
}

void fillDeck (Card *deck, char *face[], char *suit[])
{
  for ( int i = 0; i < 52; i++ )
  {
    deck.face = face [i % 13];
    deck.suit = suit [i / 13];
  }
}

void shuffle (Card *deck)
{
  for ( int i = 0; i < 52; i++ )
  {
    int j = rand () % 52;
    struct Card temp = deck ;
    deck  = deck [j];
    deck [j] = temp;
  }
}

void deal (Card *deck)
{
  for ( int i = 0; i < 52; i++ )
    printf ("%s of %s\n", deck.face, deck.suit);
}

But gcc compiler reports these errors:

luke@luke-desktop:~/Desktop/Lab$ cc pokerDeck.c
pokerDeck.c:10: error: expected �)� before �*� token
pokerDeck.c:11: error: expected �)� before �*� token
pokerDeck.c:12: error: expected �)� before �*� token
pokerDeck.c:30: error: expected �)� before �*� token
pokerDeck.c:39: error: expected �)� before �*� token
pokerDeck.c:50: error: expected �)� before �*� token

mcpp reports several times something like this:

/usr/include/alloca.h:25: error: Can't open include file "stddef.h"
    #include <stddef.h>
    from /usr/include/stdlib.h: 497:    # include <alloca.h>
    from /home/luke/Desktop/Lab/pokerDeck.c: 2:    #include <stdlib.h>

In C++, I had a similar problem: compiler didn't manage to open iostream and I solved changing .cc extension with .cpp extension.

But what about here?

Unlike in C++, a struct in C is not a type automatically. You need

typedef struct Card Card;

Or compile your code with g++.

I disagree about c++. You either code for C or for c++. You don't bounce back and forth C->C++, C++->C....

Pick one.

We'll help. Either way you have syntax errors as your code stands.

Also, learning C and C++ concurrently is not a great idea. If you have to know both for your job, pick the one that is used the most, learn it well. Then try the other.

And you will probably need to add the -std=c99 to the gcc compile line because loop initial declarations (another C++ -ism) are only allowed in C99 mode.

---------- Post updated at 10:33 AM ---------- Previous update was at 10:26 AM ----------

Hear, hear! I could not agree more.

Here is the example written in classical C

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

struct card {
    char *face;
    char *suit;
};

void fillDeck (struct card *, char *[], char *[]);
void shuffle (struct card *);
void deal (struct card *);

int main ()
{
  struct card deck[52];

  char *face [13] = {"Ace", "Deuce", "Tree", "Four", "Five",
                     "Six", "Seven", "Eight", "Nine", "Ten",
                     "Jack", "Queen", "King"};
  char  *suit [4] = {"Hearts", "Spades", "Diamonds", "Clubs"};

  srand (time (0));

  fillDeck (deck, face, suit);
  shuffle (deck);
  deal (deck);
  return 0;
}

void fillDeck (struct card *deck, char *face[], char *suit[])
{
  int i;

  for ( i = 0; i < 52; i++ )
  {
    deck.face = face [i % 13];
    deck.suit = suit [i / 13];
  }
}
void shuffle (struct card *deck)
{
  int i;

  for ( i = 0; i < 52; i++ )
  {
    int j = rand () % 52;
    struct card temp = deck ;
    deck  = deck [j];
    deck [j] = temp;
  }
}

void deal (struct card *deck)
{
  int i;

  for ( i = 0; i < 52; i++ )
    printf ("%s of %s\n", deck.face, deck.suit);
}

Yeah, those forgot "struct" in functions signatures. A very beginner's error.

Right.

Thank you all.

Edit:

Since my real problem is that I need real code instead of examples to get a real improve, could you suggest me where I can find some c and c++ free code to study? Thanks.