Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 5th, 2007, 11:38 PM   #11
357mag
Hobbyist Programmer
 
Join Date: Mar 2005
Posts: 148
Rep Power: 4 357mag is on a distinguished road
That sure is weird how when I do it the original way using quotation marks to put spaces between the digits that the last two numbers(64 and 125) under the Cube column just don't print right. If anyone can explain the reason for this I'd like to know.
357mag is offline   Reply With Quote
Old Jul 6th, 2007, 2:36 AM   #12
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Check the docs for the default padding/formatting.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Jul 6th, 2007, 3:25 AM   #13
357mag
Hobbyist Programmer
 
Join Date: Mar 2005
Posts: 148
Rep Power: 4 357mag is on a distinguished road
Man there is millions and millions and millions of stuff that I see. You would need to whittle it down quite a bit.
357mag is offline   Reply With Quote
Old Jul 6th, 2007, 8:12 AM   #14
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Well, in the first place, a duplicate of your code, running in NetBeans, does not produce what you show in your post. It produces this:
Value    Square     Cube
  1         1          1
  2         4          8
  3         9          27
  4         16          64
  5         25          125

It produces the same thing if run from the command line:

Now, if you look at that, you'll see that there are two spaces before the first column, 9 spaces between the first and second columns, and 10 spaces between the second and third columns. That's what your software is asking for, that's what you're getting.

You've asked someone to explain a phenomenon that isn't occurring. GIGO.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Jul 6th, 2007, 11:52 PM   #15
357mag
Hobbyist Programmer
 
Join Date: Mar 2005
Posts: 148
Rep Power: 4 357mag is on a distinguished road
I think I get it now. I wonder what GIGO means.
357mag is offline   Reply With Quote
Old Jul 7th, 2007, 12:05 AM   #16
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 925
Rep Power: 4 lectricpharaoh will become famous soon enough
Quote:
Originally Posted by 357mag
I think I get it now. I wonder what GIGO means.
It's an acronym for 'garbage in, garbage out'.
__________________
A man's knowledge is like an expanding sphere, the surface corresponding to the boundary between the known and the unknown. As the sphere grows, so does its surface; the more a man learns, the more he realizes how much he does not know. Hence, the most ignorant man thinks he knows it all. - L. Sprague de Camp
lectricpharaoh is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
advanced user output l2u C++ 6 May 9th, 2007 8:16 PM
Implementation of CRC32 grimpirate Other Web Development Languages 2 Mar 3rd, 2007 2:13 PM
Change the name of output file jazz C 4 Jun 28th, 2006 2:54 AM
Numerical data output to a file can342man C++ 4 Jan 27th, 2006 4:21 PM
It's giving me "Press any key to continue" and no other output.. Insomniac C 15 Jun 5th, 2005 7:07 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:11 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC