Hi All, I have got this task which I cant get my head around:It asks how I would store information:I just want to get an opinion from the group:So here''s the question: "You have been asked to write a program for a card playing friend. Howwould you store information about playing cards? For example how wouldyou store the fact that a certain card is the 7 of diamonds? (You mayuse more than one variable if you wish)" All help welcome.Thanks in advance. Radith 解决方案 enum suits {CLUBS, HEARTS, DIAMONDS, SPADES};enum faces {ACE = 1, JACK = 11, QUEEN, KING}; struct card{unsigned int rank;unsigned char suit;}; card c = {7, DIAMONDS};-Mike enum suits {CLUBS, HEARTS, DIAMONDS, SPADES}; enum faces {ACE = 1, JACK = 11, QUEEN, KING}; struct card { unsigned int rank; unsigned char suit; }; card c = {7, DIAMONDS}; struct card c = {7, DIAMONDS); Robert Gamble enum suits {CLUBS, HEARTS, DIAMONDS, SPADES}; enum faces {ACE = 1, JACK = 11, QUEEN, KING}; struct card { unsigned int rank; unsigned char suit; }; card c = {7, DIAMONDS}; struct card c = {7, DIAMONDS); Robert Gamblestruct card c = {7, DIAMONDS}; If you''re gonna be a nit-picky smart-ass, you better be correct. 这篇关于存储卡的信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-25 02:55