a little push

This is a discussion on a little push within the C++ Programming forums, part of the General Programming Boards category; well like the title says can some 1 give me a push in what way i need to fix this ...

  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
    22,166
    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()
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,764
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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, 04: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, 01:15 PM
  5. Queues
    By ramayana in forum C Programming
    Replies: 22
    Last Post: 01-01-2006, 02:08 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21