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 7083783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:13:14+00:00 2026-05-28T07:13:14+00:00

I have seen tutorials that are using an array of characters in order to

  • 0

I have seen tutorials that are using an array of characters in order to demonstrate something with a string object. For example thees tutorials:

http://www.cplusplus.com/reference/string/string/copy/

http://www.cplusplus.com/reference/clibrary/cstdlib/atoi/

I HAVE seen tutorials that are not using a char array in order to demonstrate something. At school, the teacher also doesn’t use any arrays. For me, using an array is a bit confusing at first when I’m reading the tutorial (knowing that I’m still a beginner at C++).

I’m just curious to know why are there tutorials that use a char array in order to show one or more of the things that string objects can do.

  • 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-05-28T07:13:15+00:00Added an answer on May 28, 2026 at 7:13 am

    Storing strings in arrays of characters was the original way to represent a string in the C language. In C, a string is an array of type char. The size of the array is the number of characters, + 1. The +1 is because every string in C must end with a character value of 0. This the NULL terminator or just the terminator.

    C-style strings are legal in C++ because C++ is intended to be backwards compatible with C. Also, many library and existing code bases depend on C-style string.

    Here is a tutorial on C-style strings. http://www.cprogramming.com/tutorial/c/lesson9.html

    FYI: To convert a C++ String to a C-style string, call the method c_str().

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

Sidebar

Related Questions

I have seen simple example Ajax source codes in many online tutorials. What I
In C++ I have only seen this done by converting the string object into
I have seen this line of code in several tutorials for using Unity in
I have seen many tutorials on how to compress a single file in c#.
All the tutorials I have seen seem to use *.jsf , *.faces , or
What I am aiming for is along the lines of the example at http://net.tutsplus.com/tutorials/html-css-techniques/creating-a-floating-html-menu-using-jquery-and-css/
is it possible to create a pre-loader using plainly Flex 4? I've seen tutorials
I have a Transactions object (as a part of a shopping cart) that belongs_to
I've seen many tutorials, but none of them have worked in my case, I
I have an array that successfully shows as a listview as the main activity.

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.