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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:40:03+00:00 2026-06-05T03:40:03+00:00

I have the below mentioned function in a large piece of code(in c++): void

  • 0

I have the below mentioned function in a large piece of code(in c++):

void startup(const char *&      start,
    const char *&   stop);

After this function has been called I want to access the character values i.e string stored between ‘start’ and ‘stop’.

The way I am trying to access the same is:

 char *var=(c.start);
  cout<<"\n Iterating over char pointer \n";
  while(var<=(c.stop))
  {
      cout<<*var;
      var++;
  }
  cout<<"\n";

However, while trying to access it this way I am getting the below mentioned error:

  error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

Can someone be kind enough to rectify the error…and help me access the character values

  • 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-05T03:40:05+00:00Added an answer on June 5, 2026 at 3:40 am

    All you need to do is replace the line:

    char *var=(c.start);
    

    with:

    const char *var=(c.start);
    

    Note that that const refers to the character pointed to by the pointer, not the pointer itself. So an expression like var++ is perfectly fine, since the pointer isn’t const.

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

Sidebar

Related Questions

I have a C++ code mentioned below: #include<iostream> #include<stdexcept> const long MAX = 10240000;
I have below is the html code for TD which gets appended after matching
I have the below mentioned code in a seperate class file for establishing connection
I have the below code and for some reason, rename(..) function is failing. I
I have used code described on below mentioned SO answer Change the image source
I have two checkboxes in my code as mentioned below: <input type=checkbox id=event_id name=data[Noncompetitor][event_id][]
3 I am getting error in sending mail.here below i have mentioned my code.
I have a simple requirement as mentioned below: A ListView or any control displays
I have a C++ array declared as mentioned below: CString carray[] = { A,
I have a dropdownlist having id=ddlTitle . It contains three values as mentioned below

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.