Thread: undeclared identifier and if problem

  1. #1
    Registered User
    Join Date
    May 2012
    Location
    Buxton UK
    Posts
    14

    undeclared identifier and if problem

    hello to you if you are reading this. I have been trying to get this bit of code right for a while now but i think im stuck. I have tried rewriting a few times and I think I am close.

    Could someone with experience please give this a quick fix and repost so I can see where im going wrong?

    Code:
    #include <iostream>
    using namespace std;
    
    
    
    int main ()
    {
        char question[] = "your name is: ";
                 char greeting[] = "Welcome, ";
                 char charname[10];
                 char password[] = atco;
                 
                 cout << question;
                 cin >> charname;
                 cout << greeting << charname << "!";
                 cout << endl << endl;
    
                 cout << "what is the password?:";
                 cin >> password;
                     if password = atco;
                         cout << "enter";
                     else cout if password = !
                         cout << "leave";
    
                         
                         
    
    }

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    I suggest reading the tutorial lesson 2 or 1.
    If Statements in C++ - Cprogramming.com

    C++ Tutorial - Learn C++ - Cprogramming.com

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Undeclared identifier major problem
    By Danieljax88 in forum C++ Programming
    Replies: 19
    Last Post: 03-27-2010, 01:50 PM
  2. Undeclared Identifier
    By Kayoss in forum C++ Programming
    Replies: 2
    Last Post: 04-08-2006, 10:48 AM
  3. undeclared identifier problem
    By jjj93421 in forum C++ Programming
    Replies: 13
    Last Post: 04-24-2004, 09:22 AM
  4. 'INPUT', undeclared identifier
    By bennyandthejets in forum Windows Programming
    Replies: 4
    Last Post: 08-29-2003, 06:19 AM
  5. Undeclared Identifier
    By Witch_King in forum C++ Programming
    Replies: 4
    Last Post: 09-07-2001, 12:58 PM

Tags for this Thread