Thread: first step towards C++

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Mar 2011
    Posts
    254

    first step towards C++

    Hi

    I'm a complete new to this programming world and know nothing about. My aim is to learn to C++ basic console based programming. I hope you all would kindly help me to do this.

    I copied this program from somewhere:

    Code:
    #include <iostream.h>
    #include <stdio.h>
    #include <conio.h>
    void main ()
    {
    clrscr;
    int x;
    cout<<"Enter the number to be Cubed";
    cin>>x;
    cout<<x*x*x<<endl;
    getch();
    }
    I hope there were no errors in the above source code (I think that's what you call it). Please let me tell you again that I am blank illiterate in computer programming and am self learner.

    What do these statements mean at the start: #include <iostream.h>, #include <stdio.h>, and #include <conio.h>?

    I believe in C++ every statement is separated by ";"?

    What's the purpose of writing "getch()" at the end?

    I understand it takes a lot of energy and time to help someone like me. But I would be very much indebted to you for your help and teaching me to write some basic programs. With the hope that it's going to be pleasant and informative learning experience, I await your help.

    Best wishes
    Jack

    PS: I've wrapped the code as suggested by quzah
    Last edited by jackson6612; 03-18-2011 at 12:01 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. debugging - step into issue
    By barneygumble742 in forum C++ Programming
    Replies: 7
    Last Post: 03-15-2009, 12:30 PM
  2. recursion
    By paulmedic555 in forum C Programming
    Replies: 26
    Last Post: 01-28-2005, 12:43 AM
  3. robot step sizes
    By n00by in forum C Programming
    Replies: 2
    Last Post: 04-29-2004, 03:29 PM
  4. step by step debug != run debug
    By bonkey in forum Windows Programming
    Replies: 8
    Last Post: 09-09-2002, 12:55 PM
  5. this sites Compiler Resources Specs.
    By Powerfull Army in forum C++ Programming
    Replies: 9
    Last Post: 07-08-2002, 06:12 PM