Problem

This is a discussion on Problem within the C++ Programming forums, part of the General Programming Boards category; i need help with this code. I know it is very basic and even explained in the tutorials but when ...

  1. #1
    Registered User MOH123's Avatar
    Join Date
    Aug 2005
    Posts
    20

    Problem

    i need help with this code. I know it is very basic and even explained in the tutorials but when i write it myself there is an error. here is code

    Code:
     #include <iostream>
    
    using namespace std; 
    
    int main()
    {
       for (int x = 0; x < 11; x++ ) {
           cout<< x <<end1;
       }
       cin.get();
    }
    i just cant find what is wrong with it. I copied/pasted the tutorial code which worked fine but this wont work. the error that comes is saying 'end1' is not undeclared. when i do int end1; it at least starts but doesnt do what its supposed to. please help as i am still new.

    -thanks in advance
    Games by Me:
    Using C++:
    Text Adventure game - No Name [||||||||||] - =0% -
    -----------------------------------------------
    Using RPG Maker 2000 and 2003:
    - No Games as of now -

  2. #2
    Nonconformist Narf's Avatar
    Join Date
    Aug 2005
    Posts
    174
    end1 is a typo, it should be endl, with a lower case L. endl is a manipulator that stands for "end line".
    Just because I don't care doesn't mean I don't understand.

  3. #3
    1479
    Join Date
    Aug 2003
    Posts
    253
    its end L not end 1

    Code:
    //right way
    cout <<endl;
    //wrong way
    cout <<end1;
    see the difference?
    Knowledge is power and I want it all

    -0RealityFusion0-

  4. #4
    Registered User MOH123's Avatar
    Join Date
    Aug 2005
    Posts
    20
    k, thanks guys
    Games by Me:
    Using C++:
    Text Adventure game - No Name [||||||||||] - =0% -
    -----------------------------------------------
    Using RPG Maker 2000 and 2003:
    - No Games as of now -

  5. #5
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    In the future, stating the problem you are having is a more effective way of getting results.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 05:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 09:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 03:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 07:54 PM

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