The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

How do you make cout do columns? by oot 2004-12-06 14:52:31
I have an object that has four fields: a six-digit number, a 0-20 character email address, a 12-character phone number, and a 0-30 character name. When the email address or name is less than its maximum width, I would like to pad it with spaces to that maximum width so it shows up in columns when I display a bunch of these objects. How do I make cout do that?
[ Reply ]
  Simplest way is via 'manipulators'. by williamashbless2004-12-06 14:56:35
    Thank you! :-) by oot2004-12-06 14:57:37
    Hmm, interesting. by LionsPhil2004-12-06 15:00:12
      oot specifically asked about cout... by williamashbless2004-12-06 15:03:22
        Bah! by LionsPhil2004-12-06 15:04:29
          *shiver* *LARTs LionsPhil* (n/t) by williamashbless2004-12-06 15:07:50
            Foo *x = new Foo(malloc(23)); >=) (n/t) by LionsPhil2004-12-06 15:09:35
              *LART* *LART* *LART* (n/t) by williamashbless2004-12-06 15:11:30
                *joins in the LARTing* (n/t) by DaNutBall2004-12-06 15:14:40
              Hmm by Liava2004-12-06 15:17:16
                I think you made a boo-boo. by LionsPhil2004-12-06 15:25:27
                  Nope, I meant what I wrote. by Liava2004-12-06 15:26:04
                  free(bar)? by wheresthefish2004-12-06 15:31:20
                    struct mug *fishpint=malloc(sizeof(struct mug)); by LionsPhil2004-12-06 15:35:47
                      *giggle* You guys are awesome! (n/t) by oot2004-12-06 17:55:59
              My head a splode! (n/t) by oot2004-12-06 15:21:14
          So, if you mix them 50/50, is that just C+? *flee* (n/t) by Merlin2004-12-06 15:09:18
          Anyway, C++ is only C with cout and a .cc filename (n/t) by wheresthefish2004-12-06 15:16:44
            Heh, indeed by Liava2004-12-06 15:18:21
            and new, and delete, and that "object" stuff... by bobmon2004-12-06 15:20:32
              Objects are for people who can't write functions. by wheresthefish2004-12-06 15:29:32
                Header file? HEADER FILE? by LionsPhil2004-12-06 15:33:28
                Functions are for people who can't keep their spag by bobmon2004-12-06 15:47:15
                  OK, where did I put that by ManiacJoe2004-12-06 15:58:42
                  That is so vulgar by Ston2004-12-06 16:05:51
            Rubbish! by LionsPhil2004-12-06 15:26:57
              Ran out of characters on the subject line. by wheresthefish2004-12-06 15:34:58
        Prof of mine did that for an entire course by phezult2004-12-06 15:23:06
  A question because I'm curious: by phezult2004-12-06 15:02:22
    That's precisely the reason. by williamashbless2004-12-06 15:07:22
      What I've always wondered by phezult2004-12-06 15:20:47
        That's exactly what later software design... by williamashbless2004-12-06 15:33:02
        For grading purposes: what happens if a student.. by bobmon2004-12-06 15:35:11
          In the computer architectire course I'm TAing... by nix2004-12-06 15:40:42
            Good approach. Ideally, put only the object files by bobmon2004-12-06 15:52:12
    That's a big reason by ToLazyToThink2004-12-06 15:11:05
    I'm using gcc by oot2004-12-06 15:19:13

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)