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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:27:28+00:00 2026-05-22T18:27:28+00:00

std::array is vastly superior to the C arrays. And even if I want to

  • 0

std::array is vastly superior to the C arrays. And even if I want to interoperate with legacy code, I can just use std::array::data(). Is there any reason I would ever want an old-school array?

  • 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-22T18:27:29+00:00Added an answer on May 22, 2026 at 6:27 pm

    Unless I’ve missed something (I’ve not followed the most recent changes in the standard too closely), most of the uses of C style arrays still remain. std::array does allow static initialization, but it still won’t count the initializers for you. And since the only real use of C style arrays before std::array was for statically initialized tables
    along the lines of:

    MyStruct const table[] =
    {
        { something1, otherthing1 },
        //  ...
    };
    

    using the usual begin and end template functions (adopted in
    C++11) to iterate over them. Without ever mentionning the size, which the compiler determines from the number of initializers.

    EDIT: Another thing I forgot: string literals are still C style arrays; i.e. with type char[]. I don’t think that anyone would exclude using string literals just because we have std::array.

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

Sidebar

Related Questions

How can I use std::shared_ptr for array of double? Additionally what are advantages/disadvantages of
I have the following code. Basically I want to initialize a std::array of non-POD
How can I use a std::valarray to store/manipulate a 2D array? I'd like to
Is the data in std::array<std::array<T,N>, M> guaranteed to be contiguous? For example: #include <array>
I have a deque that contains std::arrays . I want to convert it to
When should I use std::string and when should I use char* to manage arrays
Benefits of C++11 std::array s when programming have been explained by experts, but there
What is the difference between std::array and std::vector ? When do you use one
I want to construct a std::string object like an array: std::string str(); str[0] =
I have defined two dimensional array using following definition typedef std::vector<std::vector<short> > table_t; Can

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.