Search Results

Showing results 1 to 8 of 8
Search took 0.00 seconds.
Search: Posts Made By: mike_g ; Forum: C and child forums
Forum: C Dec 23rd, 2008
Replies: 2
Views: 322
Posted By mike_g
Like salem said, you would be better off with a decent compiler such as gcc. If its not a problem with your compiler, then I'd guess you are not linking the library properly. Its been a while, but I...
Forum: C Dec 23rd, 2008
Replies: 7
Views: 740
Posted By mike_g
You might want to take a look at strtok (http://www.cplusplus.com/reference/clibrary/cstring/strtok.html).
Forum: C Aug 22nd, 2008
Replies: 21
Views: 2,747
Posted By mike_g
Yes, but first you are going to have to learn how to read. You could practice with this (http://www.catb.org/~esr/faqs/smart-questions.html). Then learn how to converse with other people...
Forum: C Aug 22nd, 2008
Replies: 8
Views: 1,187
Posted By mike_g
Something like:
int card = 39;
char suit = (card / 10)+'A';
int rank = (card % 10)+1;
printf("suit: %c, rank: %d", suit, rank);


IMO the easiest way to do this would be to load the entire...
Forum: C Aug 22nd, 2008
Replies: 21
Views: 2,747
Posted By mike_g
Since the result is a float I still reckon the easiest way to go about it would be to use sprintf and parse the string, but the op dosent seem to be interested in that idea :/
Forum: C Aug 20th, 2008
Replies: 21
Views: 2,747
Posted By mike_g
Have you tried converting the result to a string yet? that should make a good first step.
Forum: C Aug 20th, 2008
Replies: 8
Views: 1,187
Posted By mike_g
You should be able to store the data for each card within an integer. You could then get the suit as card / 10 and you could get the rank as card % 10. I find this approach simplifies things a...
Forum: C Aug 20th, 2008
Replies: 21
Views: 2,747
Posted By mike_g
If I was doing this I think I would use sprintf to convert the numeric result to a string then parse the characters building the words from it:...
Showing results 1 to 8 of 8

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC