Thread: CODE

Results 1 to 7 of 7
  1. #1
    Pxpc2's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    231
    Reputation
    6
    Thanks
    11
    My Mood
    Angelic

    Question CODE

    Whats wrong with my code?

    Code:
    /*
       Credits:
       --Pxpc2 C++ book
       */
    
    #include <iostream>
    using namespace std;
    
    int main ()
    {
    	int length; // this should declare a variable.
    	int width; // this should declare another variable.
    
    	cout << "Enter the Length: ";
    	cin >> length; // ....................................................../////////
    
    	cout << "enter the width: ";
    	cin >>; // lalalalalalala
    
    	cout << "The area is ";
    	cout << length * width; // ...
    
    	return 0
    }
    Used to let the user to insert the rectangle dimensions

  2. #2
    Melodia's Avatar
    Join Date
    Dec 2009
    Gender
    female
    Posts
    2,608
    Reputation
    276
    Thanks
    1,662
    My Mood
    Dead
    So ; I heard you Liek Semicolons and Get's ?
    Love You All~

  3. #3
    Gab's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    6,716
    Reputation
    1755
    Thanks
    1,543
    cin >>; // lalalalalalala

    to

    cin >> width; // lalalalalalala

  4. #4
    Melodia's Avatar
    Join Date
    Dec 2009
    Gender
    female
    Posts
    2,608
    Reputation
    276
    Thanks
    1,662
    My Mood
    Dead
    Quote Originally Posted by xXModz View Post
    cin >>; // lalalalalalala

    to

    cin >> width; // lalalalalalala
    If you are to spoonfeed him at least tell him he needs the semicolon after the return Value.
    Love You All~

  5. The Following 4 Users Say Thank You to Melodia For This Useful Post:

    Hassan (05-03-2011),Hell_Demon (05-04-2011),[MPGH]master131 (05-04-2011),whit (05-04-2011)

  6. #5
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,670
    My Mood
    Breezy
    Look over your code. You're trying to get user input and put the entered value into a semi-colon (which is not possible). Also you forgot a semi-colon after return 0 which will cause the code to 'unexpectedly' end.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  7. The Following 2 Users Say Thank You to master131 For This Useful Post:

    Hell_Demon (05-04-2011),whit (05-04-2011)

  8. #6
    Pxpc2's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    231
    Reputation
    6
    Thanks
    11
    My Mood
    Angelic
    Oh thanks alot

    /Req close

  9. #7
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    ~ Closed on request ~
    Ah we-a blaze the fyah, make it bun dem!