Thread: I'm stupid, heres why(it doesnt work!)

  1. #1
    Unregistered
    Guest

    I'm stupid, heres why(it doesnt work!)

    I'm new at programming(I started about... an hour ago?), and this dumb little program i tried to make doesn't work... TELL ME WHY!

    #include <iostream.h>
    int main()
    {
    int a,b,c,d,e,f,g,h;
    cout<<"Welcome to the Age Finder! What year is it now?";
    cin>>a,b,c,d;
    cout<<"Ah, yes! Now I remember...The year is "<<a,b,c,d;
    cout<<" Speaking of the year, what year were you born in?";
    cin>>e,f,g,h;
    cout<<" Wow..."<<e,f,g,h;
    cout<<" That means you must be ";
    cout<<(a,b,c,d-e,f,g,h);
    cin.get();
    return 0;
    }

  2. #2
    Evil Member
    Join Date
    Jan 2002
    Posts
    638
    Cin delimits at whitespace, not individual characters. Make 2 variable of type int and cin to them. then subtract one from the other.

  3. #3
    Unregistered
    Guest
    Thanks dude... ON to tutorial number 2!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. stupid, stupid question
    By xelitex in forum C++ Programming
    Replies: 5
    Last Post: 12-22-2004, 08:22 PM
  2. If you are employed as a programmer, please look
    By Flood Fighter in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 09-28-2004, 02:35 AM
  3. Loading a BMP....it should work.
    By VirtualAce in forum Game Programming
    Replies: 12
    Last Post: 08-14-2004, 08:08 AM
  4. At Work...Need C++....
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 06-04-2004, 12:36 AM
  5. Stupid people should wear SIGNS
    By C_Coder in forum A Brief History of Cprogramming.com
    Replies: 19
    Last Post: 07-15-2002, 08:49 AM