Click here to Skip to main content
15,885,914 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C++
#include <iostream>
#include <cstdlib>

using namespace std;
#include <iostream>
#include <cstdlib>

using namespace std;

// note C:\Dev-Cpp\include\c++\3.4.2\iosfwd:62 candidates are: std::basic_istream<char,> >& std::basic_istream<char,> >::operator=(const std::basic_istream<char,> >&) 
//16 C:\Dev-Cpp\Untitled1.cpp no match for 'operator=' in '(&std::cin)->std::basic_istream<_CharT, _Traits>::operator>> [with _CharT = char, _Traits = std::char_traits<char>](((int&)(&list))) = 1' 

int main()
{
    system("cls");
    system("title Command Game!");
    
    int list;
    cout << "Type ''list'' for options. \n\n\n\n\n\n\n\n\n \n";
    cin >> list;
    if(list == 1); 
   {
            system("color a");
       cout << "List: 1. Crack The Code,   2. Exit,     3. Cheats - - - - \n \n \n \n        ";
       int main;
       }
       
       int Code_Command();
       int code;
       cout << "New Code?";
       cin >> code;
       if(code == 1);
       {
               int Exit_Command;
               int level1;
               }
       
}
int Exit_Command()
{
    system("cls");
    int exit;
    cout << "Good-Bye!";
    cin >> exit;

    if(exit == 1);
    {
            system("PAUSE");
            return 0;
            }
            }
    
int Cheat_Command()
{
 int cheats;
 cout << "Cheater. :D";
 cin >> cheats;
 
 if(cheats == 1);
 {
           system("cmd");
 system("PAUSE");
 return 0;
 int level1;
}
}

 int level1();
 {
 system("title Level 1");
 cout << "Level 1: EASY.    Most people know this word from Marry Poppin's: ";
 cin >> supercalafragilisticexpealidocious;
 if(supercalafragilisticexpealidocious == 1);
 {
                                       int level2;
                                       }
                                       }
 int level2();
 {
 system("title Level 2");
 cout << "Level 2: MEDIUM.    A giant, well known hacking group of 2010 with no personalities known."
 cin >> anonymous;
 if(anonymous == 1);
 {
              int level3;
              }
}
 
 
 
 
 
 
 THIS WON'T RUN!!! HELP?!</char></cstdlib></iostream>
Posted
Updated 12-Aug-13 10:46am
v4
Comments
Member 10205042 12-Aug-13 14:28pm    
It's a simple command game. Don't freak out when it says "hack".
Sergey Alexandrovich Kryukov 12-Aug-13 14:39pm    
No problem at all, in my opinion. The problem is the lack of explanation of what exactly do you want to achieve.
—SA
[no name] 12-Aug-13 14:28pm    
It really helps if you tell us what the error actually is instead of trying to make us guess. Try if(cin >> list == 1);
Member 10205042 12-Aug-13 14:51pm    
//error is here
if(cin >> list = 1);
//error is here
[no name] 12-Aug-13 14:55pm    
Like I said, it really helps to tell us what the error actually is. "error is here" does not tell us what the error message is.

1 solution

Study the following lines of C++ code and note the differences:

C++
if(cin >> list = 1);
if(cin >> list == 1);
if(cin >> list == 1)

cin >> list;
if(list == 1)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900