Zelaron Gaming Forum  
Stats Arcade Portal Forum FAQ Community Calendar Today's Posts Search
Go Back   Zelaron Gaming Forum > The Zelaron Nexus > Science and Art > Tech Help

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next

 
Evil Grin Compile error?! Explain somone plz. "Example code of a CD, unchanged"
Reply
Posted 2004-08-04, 01:35 AM
for some reason i get a compile error on the following.
dont know why, this is an example code from my CD that came with my book i got today. it is supost to work as is, without me chanign anything (witch i havent) but when i go to compile it i get the following error

14 c:\docume~1\kida\desktop\programs\conver~1.cpp
`class _IO_ostream_withassign' has no member named `alpha'

what the hell is going on? this code is in the book and the example is off the CD, and it gets compile error? plz plz plz explain this, try compileing it yourself.

all this code does is look at two number input my th euser, and tells you if they are even by stating true or false.



heres the code..
Code:
// BoolTest - compare variables input from the
//            keyboard and store the results off
//            into a logical variable
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;

int main(int nNumberofArgs, char* pszArgs[])
{
    // set output format for bool variables
    // to true and false instead
    // of 1 and 0
    cout.setf(cout.alpha);

    // initialize two arguments
    int nArg1;
    cout << "Input value 1: ";
    cin >> nArg1;

    int nArg2;
    cout << "Input value 2: ";
    cin >> nArg2;

    bool b;
    b = nArg1 == nArg2;
    
    cout << "The statement, " << nArg1
         << " equals "        << nArg2
         << " is "            << b
         << endl;

    // wait until user is ready before terminating program
    // to allow the user to see the program results
    system("PAUSE");
    return 0; 
}
Old
Profile PM WWW Search
Kidagakash is neither ape nor machine; has so far settled for the in-betweenKidagakash is neither ape nor machine; has so far settled for the in-between
 
 
Kidagakash
 



 

Bookmarks

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules [Forum Rules]
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 04:18 PM.
'Synthesis 2' vBulletin 3.x styles and 'x79' derivative
by WetWired the Unbound and Chruser
Copyright ©2002-2008 zelaron.com
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.