Thread: what's wrong with this code

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Registered User codingmaster's Avatar
    Join Date
    Sep 2002
    Posts
    309
    wrong bracket usage
    redeclaration
    old headers
    why a loop here???

    Here is a simple code:

    Code:
    #include <iostream>
    using namespace std;
    
    int main()
    {
    cout << "Please input your name: ";
    char string[256]; // string with max. 256 characters
    cin.getline(string,'\n');
    
    cout << "\nWelcome " << string << endl;
    
    system("pause");    // to keep the window open
    
    return 0;
    }
    Last edited by codingmaster; 06-01-2003 at 11:30 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. what is wrong in this simple code
    By vikingcarioca in forum C Programming
    Replies: 4
    Last Post: 04-23-2009, 07:10 AM
  2. what is wrong with this code please
    By korbitz in forum Windows Programming
    Replies: 3
    Last Post: 03-05-2004, 10:11 AM
  3. I cant find what is wrong with this code
    By senegene in forum C Programming
    Replies: 1
    Last Post: 11-12-2002, 06:32 PM
  4. Anyone see what is wrong with this code?
    By Wise1 in forum C Programming
    Replies: 2
    Last Post: 02-13-2002, 02:01 PM
  5. very simple code, please check to see whats wrong
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 10-10-2001, 12:51 AM