Format
Dec 31, 2010 at 11:08am UTC
Hi, I have a problem with format
This is the screenshot
http://i53.tinypic.com/dxxyr7.jpg
output text " * " in my program doesn't in the same line
I want " * " is under player2 player3 player4
this is part of the code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
char player1card[13][15];
char player2card[13][15];
char player3card[13][15];
char player4card[13][15];
char star[2] = "*" ;
//split cars
printf("\n\n Your Cards : Player 2 cards : Player 3 cards : Player 4 cards : \n\n" );
printf("\n\n\n" );
for (i=0; i<13; i++)
{
strcpy(player1card[i], Deck[i]);
strcpy(player2card[i], Deck[i+13]);
strcpy(player3card[i], Deck[i+26]);
strcpy(player4card[i], Deck[i+39]);
printf(" %s%20s%20s%20s\n" , player1card[i], star, star, star);
Hmm, maybe this is because %20s <<<?
Dec 31, 2010 at 1:30pm UTC
I'm not familiar with format tags.
Try to use setw with cout
Topic archived. No new replies allowed.