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

  • Home
  • SEARCH
  • 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 8895947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:54:58+00:00 2026-06-14T23:54:58+00:00

I am trying to add some text values into an array such as some

  • 0

I am trying to add some text values into an array such as

  • some value 1
  • some value 2
  • some value 3
  • etc..

here is the procedure i follow:

char values_array[3][80];
values_array[0][80] = "Rock and Rolla";
cout << values_array[0] << endl;

and i get the following error:

invalid conversion from `const char*' to `char' 
  • 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-14T23:54:59+00:00Added an answer on June 14, 2026 at 11:54 pm

    The error message states exactly what the problem is. The assignment is attempting to assign a const char*, the type of string string literal, to a char, the type of values_array[0][80]. The incorrect immediate response would be change it to:

    values_array[0] = "Rock and Rolla";
    

    but this is also incorrect as it is not possible to assign arrays. Either copy the string literal or, preferably, use a std::vector<std::string> instead:

    std::vector<std::string> values;
    values.push_back("Rock and Rolla");
    
    std::cout << values[0] << std::endl;
    

    Using a std::vector<std::string> eliminates the hard-coded limit on the number of strings that can be stored and potential buffer-overrun problems when copying the string literals (or other strings) into the array elements.

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

Sidebar

Related Questions

I'm trying to add some HTML formatted text to Word using Office Interop. My
I am trying to load an image and add some text to it. my
I am trying to add and image and then put some text(title) on the
I'm trying yo add text to the editor using some buttons, So actualy I've
I am trying to add some Values to a Database with PHP I send
I'm trying to add some views into the screen, and I want them to
I'm trying to put into form ( select ) some values from database: val
Need some help to add PHP into HTML. I am trying to embed PHP
Im trying to add some short file names to a Wise installer to fix
I am trying to add some error detection to a script that is used

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.