super n00b prob .. -_-

This is a discussion on super n00b prob .. -_- within the C++ Programming forums, part of the General Programming Boards category; ughhhhhhhhh totally erased this because my question was dumb and i actually did figure out what i did wrong....

  1. #1
    Registered User helloalyssa's Avatar
    Join Date
    Sep 2010
    Posts
    25

    super n00b prob .. -_-

    ughhhhhhhhh totally erased this because my question was dumb and i actually did figure out what i did wrong.
    Last edited by helloalyssa; 09-28-2010 at 01:59 PM.

  2. #2
    Registered User helloalyssa's Avatar
    Join Date
    Sep 2010
    Posts
    25
    lolz nvm i figured it out -_-

  3. #3
    a guy with long hair Xupicor's Avatar
    Join Date
    Sep 2010
    Location
    Poland
    Posts
    103
    This is how you define vars of the same type in one line:
    Code:
    int father, mother, daughter, son;
    string one, two, three, four;
    When you define a variable, you put a semicolon at the end - ;

    Also, you know, you can have a runtime error if your file will not open.
    Code:
    outputFile.open("SalesTaxData.txt");
    if (outputFile.good()) {
        // now you can work with the file, 
    } else {
        // here you can provide the user with error message
    }

  4. #4
    Registered User helloalyssa's Avatar
    Join Date
    Sep 2010
    Posts
    25
    ugh i don't know why i had commas. anyway i thought i fixed it but it still cuts off (it just ends) after it displays "please enter the year for this report:".

  5. #5
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,538
    Well, month doesn't really contain anything, does it? It's empty. Same for year.
    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.

  6. #6
    a guy with long hair Xupicor's Avatar
    Join Date
    Sep 2010
    Location
    Poland
    Posts
    103
    And that would be because you need to actually ask the user for the data, not only write a comment about it in source code.

  7. #7
    Registered User helloalyssa's Avatar
    Join Date
    Sep 2010
    Posts
    25
    look you don't need to be excessively sarcastic if you think my question is silly, i already know it is.

    i am asking the user for data.
    and no, neither month or year contain data because i'm supposed to input them when i'm running the program.

  8. #8
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,538
    In any case, there is nothing wrong with the code (save for what was already pointed out; and the missing newline).
    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.

  9. #9
    a guy with long hair Xupicor's Avatar
    Join Date
    Sep 2010
    Location
    Poland
    Posts
    103
    helloalyssa, was that really *overly* sarcastic? Well, maybe you could paste your code again, with the fixes, for us to see why it still doesn't work. Because at the snippet above there is no code that would actually ask the user for data. You know, std::cin or something like std::getline().

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help with loops - super n00b
    By antipesto93 in forum C++ Programming
    Replies: 2
    Last Post: 06-15-2010, 09:57 AM
  2. Deal or No Deal listbox prob
    By kryptkat in forum Windows Programming
    Replies: 5
    Last Post: 03-30-2009, 06:53 PM
  3. With super powers would you:
    By Jeremy G in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 09-17-2003, 11:27 PM
  4. super n00b:(
    By Pheonix in forum C++ Programming
    Replies: 17
    Last Post: 07-24-2003, 04:35 PM
  5. Which super hero(ine) are you?
    By biosninja in forum A Brief History of Cprogramming.com
    Replies: 21
    Last Post: 10-15-2002, 06:36 AM

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