Thread: a little push

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    34

    a little push

    well like the title says can some 1 give me a push in what way i need to fix this to get it to compile
    this is basicly some 1 the first stuff iv done whitout copying and pasting and stuff like that so please don't say anythange about it



    Code:
    #include <iostream>
     using namespace std;
     int main()
     {
     int factor;
     factor = 111111;
    
       int Keyboardinput;
     
     cout<<"enter a password: ";
     
           cin>> Keyboardinput;
             cin.ignore(); 
       if ( factor = keyboardinput )
       
         cout<<"i love you"<<endl;
           else
             cout<<"you don't have the pass word"<<endl;
       
       system("PAUSE");      
     return o;
     }
    please don't tell me all waht is rong whit it cuse then i wont learn any thang

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Code:
    return 0;

  3. #3
    Registered User
    Join Date
    Nov 2005
    Posts
    34
    hehe well that tacks me down to 2 errors

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Another problem is with if ( factor = keyboardinput ), in which you assign the non-existent variable keyboardinput (notice capitalisation, or lack thereof) to the factor variable.

    Oh, and you need to #include <cstdlib> to use system()
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Registered User
    Join Date
    Mar 2006
    Posts
    6
    Another thing...

    (factor = keyboardinput) wrong...
    (factor = Keyboardinput)

    ------------------------------------------------

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Not to mention using = where == was probably needed
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  7. #7
    Registered User
    Join Date
    Nov 2005
    Posts
    34
    that every 1 iv got it working now still more to be done whit it but this will do for a start
    just to let ya no what it is its a password holder for my online games=)

  8. #8
    Registered User
    Join Date
    Mar 2006
    Posts
    25
    um, lol, nevermind hehe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. swapping pointers
    By csvraju in forum C Programming
    Replies: 17
    Last Post: 04-01-2009, 03:18 AM
  2. Help calling function is asm
    By brietje698 in forum C++ Programming
    Replies: 24
    Last Post: 12-06-2007, 04:48 PM
  3. Inline asm
    By brietje698 in forum C++ Programming
    Replies: 5
    Last Post: 11-11-2007, 02:54 PM
  4. Getting position from game..
    By brietje698 in forum C++ Programming
    Replies: 1
    Last Post: 10-26-2007, 12:15 PM
  5. Queues
    By ramayana in forum C Programming
    Replies: 22
    Last Post: 01-01-2006, 02:08 AM