TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALL
from: CHRISTIAN FELDE
date: 1997-10-26 11:13:00
subject: Help me...

Hi all..
I've just started reading a C++ book, and I'm using Linux to compille the 
source.
I try to compille this source:
/*
somefun.cpp
Ian M Wilks
*/
#include 
void main()
{
        char yesOrNo;
        int year = 1997;
        int birth_year;
        int ageThisYear;
        cout << "\nThis program illustrates the use of variables.\n"
        cout << "Please enter your year of birth: "
        cin >> birth_year;
        cout << "Is the year still " << year << ". (Y/N): ";
        cin >> yesOrNo;
        if ((yesOrNo == `N`) || (yesOrNo == `n`))
        {
                cout << "Please enter current year (1997): ";
                cin >> year;
        }
        ageThisYear = year - birth_year;
        cout << "You are " << ageThisYear << " this year.\n";
        cout << "You are obviously ";
        if (ageThisYear < 13)
                cout << "a young person.";
        else
        if ((ageThisYear >= 13) && (ageThisYear < 20))
                cout << "a teenager.";
        else
        if ((ageThisYear >= 20) && (ageThisYear < 40))
                cout << "a person waiting for life to begin!!);
        else
        if ((ageThisYear == 40)
        else
        if ((ageThisYear > 40) && (ageThisYear < 60))
                cout << "a person who wonders if work is worth it!!";
        else
                cout << "a person in the prime of life.";
}
...but I only get this error:
sco-systems:~/work/code# g++ somefun.cpp somefun.cpp:48: unterminated string 
or character constant somefun.cpp:40: possible real start of unterminated 
constant sco-systems:~/work/code#
...and I don't understad any thing!
Help me! Thanx...
         __ __ __ __ _  _
        /_ // / // ///\//      email: cfelde@online.no
_ _ __ __//_ /_//_//_///    homepage: http://home.sol.no/~cfelde/
--- BBBS/L v3.33 How
---------------
* Origin: Fluxpod Information eXchange, telnet://fix.no (2:210/30)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.