Jump to content

c0ld

Members
  • Content Count

    111
  • Joined

  • Last visited

Posts posted by c0ld


  1. If you are a slower learner or just like a deeper understanding of how stuff works, start with BASIC. Whatever language you start with, Google "<language> tutorial" to get started, unless you want to buy a book. If you do get a book, do _not_ get a Dummies book if you want to learn anything at all. I made the mistake of picking up a C++ For Dummies... the first program they have you do is a Celcius to Fahrenheit converter (WAY to complicated for beginners), they do not explain things in any detail at all... exampe: "When we say 'int main(void)', we are decalring a preprocessor directive." They then proceed to leave you wondering what a preprocessor directive is. And they throw a plethora of terrible humor in there instead of explaining things like preprocessor directive. Sorry for the rant, but I cannot stand the For Dummies books.


  2. How do you get file input stream to detect the end of a line?

    If I have a file that looks like this:

    Jim
    80 90 100
    Joe
    70 80 90

    And wanted output (cout) to look like this:

    Jim: 90
    Joe: 80

    With those numbers being the averages of Jim's three and Joe's three respectively, how would I get the program to detect the new line? If there was some special character to denot the end of a set of numbers, I could do it, but there is not, so I cannot. :(


  3. Here is what I would do, seems more effecient.

    #include <iostream>
    #include <stdlib.h>
    
    using namespace std;
    
    int nOne = 1;
    int answer;
    
    int main(){
    
    cout << "Enter Password: ";
    cin >> answer;
    
    if(answer != nOne){
     cout << "Wrong one!\n";
    }
    else{
     cout << "You win!\n";
    }
    system("PAUSE");
    return 0;
    }


  4. I was going for simplicity and this popped out.. Eh, I think it looks kind of nice ;)

    I had to lower the quality so I could post it, at max it's 1016KB :huh: If you want the max quality one I'll have to give it to you directly, I don't have the means of hosting it. <_<

×
×
  • Create New...