Counting input words

This is a discussion on Counting input words within the C++ Programming forums, part of the General Programming Boards category; Did you just do the problem for him (or her)? Why?...

  1. #16
    Registered User
    Join Date
    Jan 2005
    Posts
    7,317
    Did you just do the problem for him (or her)? Why?

  2. #17
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Katy, Texas
    Posts
    2,309
    Well..... yes.... I guess I did finish it. Not sure how I can justify my action. I guess I figured the OP was pretty much there and had demonstrated real effort towards solving it, but was over complicating things.

    No excuses. I finished it for them. If the mods feel it is inappropriate, pull it.

  3. #18
    Registered User
    Join Date
    Jan 2005
    Posts
    7,317
    There's no official rule against doing people's work for them that I know of, and I didn't think it was a homework assignment (it might be), so it's not that big of a deal. I was just wondering. If you feel it is inappropriate, then you can pull it.
    Last edited by Daved; 01-17-2008 at 12:14 PM.

  4. #19
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,587
    You just copied the poor indenting, too. The OP is mixing tabs n' spaces!
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #20
    Registered User
    Join Date
    Jan 2008
    Posts
    11
    Quote Originally Posted by Elysia View Post
    You just copied the poor indenting, too. The OP is mixing tabs n' spaces!
    How am I? If the tabs don't line up like I want them to, I use spaces to put them in the right position.

    Thanks for the solve, Todd Burch, I see now what I did wrong. And no, this was not a homework assignment.

  6. #21
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,587
    Quote Originally Posted by Soulrivers View Post
    How am I? If the tabs don't line up like I want them to, I use spaces to put them in the right position.
    But the thing is, you shouldn't. Just use tabs to indent, and you don't need to line it up anymore.
    Mixing the two will only cause the code to become misaligned when you copy it elsewhere, outside your IDE.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #22
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,712
    Alternatively, just use spaces to indent. This is a situation where you cannot have your tabs and eat the spaces too
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  8. #23
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Elysia View Post
    But the thing is, you shouldn't. Just use tabs to indent, and you don't need to line it up anymore.
    Mixing the two will only cause the code to become misaligned when you copy it elsewhere, outside your IDE.
    Or use all spaces - most editors/IDE's have a setting to select whether you want spaces or tabs for indentation.

    Modern editors and IDE's are also usually capable of "autoindenting", which will make life better for you.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  9. #24
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,587
    Or just use all tabs! You don't need to line-up code at all. Tabs is perfectly fine for making readable code!
    Tabs vs. spaces is a big argument with both sides favoring one over the other, so there's no real point in saying which one is better.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  10. #25
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Elysia View Post
    Or just use all tabs! You don't need to line-up code at all. Tabs is perfectly fine for making readable code!
    Tabs vs. spaces is a big argument with both sides favoring one over the other, so there's no real point in saying which one is better.
    Yes - what I said was just that there are two alternatives [I have my thoughts about which is better, and I know this is just as difficult to resolve as the battle over which Christian form is "better" - Protestantism or Catholicism]. But there's absolutely no need to MIX the two - that is DEFINITELY a way to confuse everything and anything.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  11. #26
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,587
    Quote Originally Posted by matsp View Post
    But there's absolutely no need to MIX the two - that is DEFINITELY a way to confuse everything and anything.
    100% Agreed
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  12. #27
    Registered User
    Join Date
    Jan 2008
    Posts
    11
    Fine, I see your point. I'll try using only tabs in the future, thanks.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. counting lines , chars from an input file need help
    By Mshock in forum C++ Programming
    Replies: 26
    Last Post: 07-12-2006, 11:30 AM
  2. Trouble with a lab
    By michael- in forum C Programming
    Replies: 18
    Last Post: 12-06-2005, 10:28 PM
  3. Words waiting in input buffer
    By the person in forum C++ Programming
    Replies: 2
    Last Post: 10-09-2001, 09:44 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21