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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:02:56+00:00 2026-06-07T23:02:56+00:00

I wrote some JavaScript code but now I want to translate it to C++

  • 0

I wrote some JavaScript code but now I want to translate it to C++ because of perfomance, but my knowledge of C++ is low.

In JavaScript I can do:

var arr=[[['à','á'],['è','é'],['ì','í'],['ò','ó'],['ù','ú']],['a','e','i','o','u']];

How can I do something like that in C++?
Must I do

vector<vector<char>> arr;

and then set each element manually?

arr[0][0]='à';
arr[0][1]='á';
...
  • 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-07T23:02:57+00:00Added an answer on June 7, 2026 at 11:02 pm

    Yes, it’s at least a bit more work unless you have C++11, which adds the possibility of constructors taking an initializer list:

    std::vector<std::vector<char>> arr {{'a', 'b'}, {'c', 'd', 'e'}, {'f'}};
    

    You might also consider replacing std::vector<char> with std::string.

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

Sidebar

Related Questions

I want a piece of Javascript code or some guidance on how to write
I wrote some JavaScript to move an ad banner when the user is scrolling.
Here is some javascript that I wrote that attempts to change the theme of
I wrote some code in VHDL that is expected to look at a rotory
I have a Javascript who works well, because yesterday i get here some very
So, I wrote some JavaScript to grab an xml file from my desktop and
I am developing an application for iPhone but I write JavaScript. I store some
So I want to add some javascript to the onclick event of several controls
I wrote some JavaScript to allow editing a list of items within an HTML
I wrote a tab system using some very basic Javascript and it runs like

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.