Results 1 to 4 of 4

Thread: New to C++

  1. #1

    Thread Starter
    Hyperactive Member Jenova's Avatar
    Join Date
    Feb 2006
    Location
    Googleplex
    Posts
    413

    New to C++

    I just got hold of Visual C++ 6 and i am trying the followinf code. The only problem is the compiler says i have 1 error but i'm not sure where.

    Here is the code.

    Code:
    #Include <iostream>
    
    Using namespace std;
    
    int main()
    {
    	int intNumber;
    
    	cout << "Please enter a number";
    	cin >> intNumber;
    
    	if (intNumber > 10)
    	{
    		cout << "The Number is bigger than 10";
    	}
    	else
    	{
    		cout << "The number is less than 10";
    	}
    	return 0;
    }
    Any ideas on what the problem is

    Jenova

  2. #2
    Lively Member
    Join Date
    Jul 2005
    Location
    Belgium
    Posts
    68

    Re: New to C++

    Code:
    #Include <iostream.h>
    Instead of

    Code:
    #Include <iostream>
    I think..
    And doesn't the compiler specify the line where the error was found, and a description?

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: New to C++

    #include

    using


    Otherwise it looks fine to me.

    Double click the error in the Build output window to jump to the offending line.

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: New to C++

    VC++6 is bad and outdated. Look for a better one.

    Aside from that, what penagate said. (C++ is case sensitive) And definitely not what Guiseppe said.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width