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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:20:51+00:00 2026-05-20T18:20:51+00:00

I have a function that will pass a string and manipulate. in the function

  • 0

I have a function that will pass a string and manipulate. in the function call i am passing the string as such like myfunc ("hello");

In the function definition i have

myfunc (char *array)
{
    xxxx
};

The program is working fine, but it throws a warning “pointer targets in passing argument 1 of ‘myfunc’ differ in signedness”.

How to rectify this problem?

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

    Strings are actually arrays of constant characters. That is, the type of "hello" is const char[6].

    What this means is you cannot modify it. However, due to a silly conversion in C++, the array (in string literal form) can be implicitly converted to a non-const pointer to the first element. This is misleading, and dangerous. (Indeed, a const-stripping implicit conversion doesn’t exist anywhere else.)

    You should make sure you have a modifiable buffer instead:

    char buffer[] = "hello";
    myfunc(buffer);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Short: Is there a way to have a route-definition that will pass the CONTROLLER/ACTION
I want to have a function that will return the reverse of a list
I have a function that looks like this class NSNode { function insertAfter(NSNode $node)
I would like to create a function that will return list of type that
I have to implements a function that takes a string as an input and
Suppose that I have a unsigned char*, let's call it: some_data unsigned char* some_data;
I want to have a function that evaluates 2 bool vars (like a truth
i have been attempting to pass an object into a function that belongs to
I have some global string variables. I have to create the function that I
I am writing a program that will call a function from an external library,

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.