I use apple's x code, my system is OS X 10.4.11
Im getting a warning you must be familiar:

"#ifdef __DEPRECATED
#warning This file includes at least one deprecated or antiquated header. \
Please consider using one of the 32 headers found in section 17.4.1.2 of the \
C++ standard. Examples include substituting the <X> header for the <X.h> \
header for C++ includes, or <iostream> instead of the deprecated header \
<iostream.h>. To disable this warning use -Wno-deprecated.
#endif'

I followed the advice and zapped the ".h" and I got 10 or more errors!
I put back the deprecated <iostream.h> and got only the warning.

HELP!

ION

Can we see the total program that you are trying to compile :) Because i cant find any reason to understand what might have gone wrong.

Can we see the total program that you are trying to compile :) Because i cant find any reason to understand what might have gone wrong.

Sure thing, I'm just trying to learn C++ and I'm using a source for a game called "decryptix".
The plot thickens here:

#include <iostream.h>

int main()
{
    cout << "Decryptix. (c)Copyright 1999 Liberty";
    cout << "Associates, Inc. Version 0.2\n\n" << endl;
    cout << "There are two ways to play Decryptix: either";
    cout << "you can guess a pattern I create,\n";
    cout << "or I can guess your pattern.\n\n";
    cout << "If you are guessing, I will think of a pattern\n";
    cout << "of letters (e.g., abcde).\n\n";
    cout << "On each turn, you guess the pattern and I will\n";
    cout << "tell you how many letters you got right, and how many\n";
    cout << "of the correct letters were in the correct position.\n\n";
    cout << "The goal is to decode the puzzle as quickly as\n";
    cout << "possible. You control how many letters can be\n";
    cout << "used and how many positions (e.g., 5 possible \n";
    cout << "letters in 4 positions) as well as whether or not\n";
    cout << "the pattern might contain duplicate \n";
    cout << "letters (e.g., aabcd).\n\n";
    cout << "If I'm guessing, you think of a pattern and score \n";
    cout << "each of my answers.\n\n" << endl;


    int round = 1;
    int howManyLetters = 0, howManyPositions = 0;
    bool duplicatesAllowed = false;
    bool valid = false;

    const int minLetters = 2;
    const int maxLetters = 10;
    const int minPositions = 3;
    const int maxPositions = 10;


    while ( ! valid )
    {
        while ( howManyLetters < minLetters 
                || howManyLetters > maxLetters )
        {
            cout << "How many letters? (";
            cout << minLetters << "-" << maxLetters << "): ";
            cin >> howManyLetters;
            if ( howManyLetters < minLetters 
                || howManyLetters > maxLetters )
            {
                cout << "please enter a number between "; 
                cout << minLetters << " and " << maxLetters << endl;
            }
        }

        while ( howManyPositions < minPositions 
                || howManyPositions > maxPositions )
        {
            cout << "How many positions? (";
            cout << minPositions << "-" << maxPositions << "): ";
            cin >> howManyPositions;
            if ( howManyPositions < minPositions 
                || howManyPositions > maxPositions )
            {
                cout << "please enter a number between ";
                cout << minPositions <<" and " << maxPositions << endl;
            }
        }

        char choice = ' ';
        while ( choice != 'y' && choice != 'n' )
        {
            cout << "Allow duplicates (y/n)? ";
            cin >> choice;
        }

        duplicatesAllowed = choice == 'y' ? true : false;

        if ( ! duplicatesAllowed 
            && howManyPositions > howManyLetters )
        {
            cout << "I can't put " << howManyLetters;
            cout << " letters in " << howManyPositions;
            cout << " positions without duplicates! Please try again.\n";
            howManyLetters = 0;
            howManyPositions = 0;
        }
        else
            valid = true;
    }

    return 0;
}

I also can't see why, but I've seen the topic on other forums and all "solutions" didn't work

I'll keep fighting, but if I get lucky some real developer might solve the mystery.

Thank you for you fast reply!

Ion

Try using
#include <iostream>
instead of
#include <iostream.h>
iostream.h is a deprecated header, hence you receive the warning.

the standard c++ library exposes only one name std to the global namespace. everything else is put inside the namespace std .

change #include <iostream.h> to

#include <iostream>
using namespace std ;

without the using directive, you need to qualify names with std:: ie. std::cout etc.

I am starting to suspect the catch is my IDE.
I'm gonna try to cop another compiler and see what happens.
I thought I was a crackpot, staying 24 hours on the 'puter.
I now found out that I'm not alone...

It's good to feel like a "normal" nut.

I am surprised with how this forum is a fast reply spot.

Thanks a million, and dont get so happy, I'm ready to bug you guys whenever I get stuck with something.

If anyone ever needs any help with music just scream.
I'm a professional jazz musician. If you want to know my "criminal records" just google me up.
Do a search on "ion muniz" (use the double quotes).

Back to work,

Ion

This article has been dead for over six months. Start a new discussion instead.