How can I assign int values to const char array in my blackjack game, C <p>I'm working on a blackjack game in C. I have three functions, one to fill the deck, one for shuffling the cards and one for dealing the cards. My problem is that I don't know how to give my cards an integer value, I need that to see who wins. I would be very grateful for some input on how to solve this.</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt; #include "func.h" /*fill deck with 52 cards*/ void fillDeck(Card * const Deck, const char *suit[], const char *deck[]){ int s; for (s = 0; s &lt; 52; s++){ Deck[s].suits = deck[s % 13]; Deck[s].decks = suit[s / 13]; } return; } #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt; #include "func.h" /*shuffle cards*/ void shuffle(Card * const Deck){ int i, j; Card temp; for (i = 0; i &lt; 52; i++){ j = rand() % 52; temp = Deck[i]; Deck[i] = Deck[j]; Deck[j] = temp; } return; } #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt; #include &lt;time.h&gt; #include "func.h" /*deal cards*/ void deal(const Card * const Deck, int size, int size_1, int size_2){ int i, j, length; char anotherCard[2]; char name1[30]; char name2[30]; printf("Name player one &gt; "); scanf("%s", name1); printf("Name player two &gt; "); scanf("%s", name2); printf("\nWelcome %s and %s, lets begin!\n\n", name1, name2); getchar(); printf("%s's card:\n", name1); for (i = 0; i &lt; size; i++){ printf("%5s of %-8s%c", Deck[i].decks, Deck[i].suits, (i + 1) % 2 ? '\t' : '\n'); } printf("\n%s's card:\n", name2); for (i = 2; i &lt; size_1; i++){ printf("%5s of %-8s%c", Deck[i].decks, Deck[i].suits, (i + 1) % 2 ? '\t' : '\n'); } printf("\nDealer card:\n"); for (i = 4; i &lt; size_2; i++){ printf("%5s of %-8s%c", Deck[i].decks, Deck[i].suits, (i + 1) % 2 ? '\t' : '\n'); } return; } #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt; #include &lt;time.h&gt; #include "func.h" int main(void){ Card allCards[52]; const char *suits[] = { "spades", "hearts", "diamonds", "clubs" }; char *decks[] = { "ace", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "jack", "queen", "king" }; int *values[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10 }; srand(time(NULL)); fillDeck(allCards, suits, decks, values); shuffle(allCards); deal(allCards, 2, 4, 6); getchar(); return 0; } /*func.h*/ struct card{ const char *suits; const char *decks; }; typedef struct card Card; void fillDeck(Card * const Deck, char *suit[], char *deck[]); void shuffle(Card * const Deck); void deal(const Card * const Deck, int size, int size_1, int size_2); #endif </code></pre>