Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9168441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:37:35+00:00 2026-06-17T15:37:35+00:00

Why do I see some code using CStrings declared differently. Some use this format

  • 0

Why do I see some code using CStrings declared differently.

Some use this format

char a_c_string [];

While others use

CString another_c_string;

Is there a difference? All the references I have found on CStrings declare it as I did in the first example, I have only seen it done the other way on forums and the like where people are giving examples.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:37:36+00:00Added an answer on June 17, 2026 at 3:37 pm

    CString is neither a C nor a C++ type. It appears to be a Microsoft invention that is essentially an alternative to std::string:

    • CString objects can grow as a result of concatenation operations.
    • CString objects follow “value semantics.” Think of a CString object as an actual string, not as a pointer to a string.
    • You can freely substitute CString objects for const char* and LPCTSTR function arguments.
    • A conversion operator gives direct access to the string’s characters as a read-only array of characters (a C-style string).

    I recommend ignoring it, so that:

    (a) people know what you are talking about;
    (b) your code is portable;
    (c) you are writing C++ that everybody can rationalise about according to the worldwide-accepted ISO C++ standard that many, many people spend many, many hours arguing about for this express purpose (y’know, as opposed to a few guys in a room in one company’s office).

    It will only be available when you are programming with Microsoft Visual C++, which is substantially limiting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code that is using SyncEnumerator. As you can see here ,
In documentation code I see some things like this: /* * @(#)File.java 1.142 09/04/01
So I'm looking through some code, and I see this: class whatever { public:
I'm starting to write some code using C++ and I have this simple class
I'm working on some code using XML RPC in ruby and need to see
Beneath this text, you can see some code for creating Arukone puzzles. But there
I have written some code using jQuery to use Ajax to get data from
I am using JUnit and embedded glassfish to test some code using CDI. This
I have an app which creates some code using CodeDom compiler. I can see
I see some code in C++ using extern C at the beginning of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.