Question: C - Card Game Pointers and Array Manipulation 3.1 Create the array char * card_names={Ace, 2, 3, ... ,10, Jack, Queen, King}; and a similar

C - Card Game
Pointers and Array Manipulation
3.1
Create the array
char * card_names={"Ace", "2", "3", ... ,"10", "Jack", "Queen", "King"};
and a similar array for the suits in the order hearts, diamonds, clubs, spades.
Write a function names(int card, int suit, char answer[]) which places a string of the name and suit of a card in the array answer[]. For example:
name(11,1) Queen of Hearts
name(8,2) 8 of Diamonds.
hint: Use pointers to copy the characters one-by-one into the array answer[] to build up the final string.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!