Thread: string name = 'JOHN';

Threaded View

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

    string name = 'JOHN';

    Hi

    I have seen someone using string in this way. Perhaps I'm using wrong syntax. Please tell me where I'm going wrong. Thanks a lot.

    Code:
    #include <iostream>
    #include <cstdlib>
    #include <string>
    
    using namespace std;
    
    int main()
    
    {
    string name = 'JOHN';
    
    cout << name;
    
    system ("pause");
    
    }
    Last edited by jackson6612; 04-27-2011 at 03:15 AM.
    I'm an outright beginner. Using Win XP Pro and Code::Blocks. Be nice to me, please.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What's up John, got a new xbox?
    By Salem in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 07-08-2007, 07:08 PM
  2. John Carmack on Facebook?
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 11-02-2006, 04:29 PM
  3. Revelations in the John
    By IfYouSaySo in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 03-18-2005, 12:58 AM
  4. John Edward - Crossing Over
    By Magos in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 03-28-2004, 09:27 AM
  5. John Carmack used goto
    By Silvercord in forum Game Programming
    Replies: 22
    Last Post: 02-06-2003, 09:21 AM