String datatype


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: String datatype

  1. #1
    C++RULES Guest

    String datatype


    Hi,

    I am a beginner C++ Programmer and in class I am writing a console function
    for the project and teacher showed us briefly about string datatype. So
    far I knew to make string, use character array. but he said we can use string
    datatype. Need help big time.

    Thanks,
    C++RULES

  2. #2
    Danny Kalev Guest

    Re: String datatype

    he was referring to the std::string class type. #include the <string>
    header and instantiate a string object as follows:

    std::string s="hello world";
    std::cout<<s; // print string

    Danny

    C++RULES wrote:
    >
    > Hi,
    >
    > I am a beginner C++ Programmer and in class I am writing a console function
    > for the project and teacher showed us briefly about string datatype. So
    > far I knew to make string, use character array. but he said we can use string
    > datatype. Need help big time.
    >
    > Thanks,
    > C++RULES


  3. #3
    L. Price Guest

    Re: String datatype


    "C++RULES" <hussaiaf@swbell.net> wrote:
    >
    >Hi,
    >
    >I am a beginner C++ Programmer and in class I am writing a console function
    >for the project and teacher showed us briefly about string datatype. So
    >far I knew to make string, use character array. but he said we can use string
    >datatype. Need help big time.
    >
    >Thanks,
    >C++RULES



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center