Get unlimited access
Open in app
Home
Notifications
Lists
Stories

Write
CodeX
Published in

CodeX

Ashley Gelwix
Ashley Gelwix

Jun 25

·
2 min read
·

error: invalid conversion from ‘const char*’ to ‘char*’

the complete solution to this very common error

Photo by Elisa Ventur on Unsplash

Trying to convert from std::string to char*

Example Code:

char* message = NULL;
message = std::string("blah blah").c_str();

--

--

More from CodeX

Everything connected with Tech & Code. Follow to join our 900K+ monthly readers

Read more from CodeX

Recommended from Medium

Gabriele de Capoa

Gabriele de Capoa

How to perform free text search in Cloudant

Opiyo A. Seba

Opiyo A. Seba

Self-Made Software Developer

Chitraxfurbish

Chitraxfurbish

Dell PE PERC H700 512MB SAS RAID Controller — XXFVX

Adam Simon

Adam Simon

in

Nanome

Matryx Q3 Release Update!

H Marie

H Marie

Scrum Certification: Is it Worth It?

Denis O

Denis O

Dependencies cache in docker multi-stage builds

Rakesh Jain

Rakesh Jain

in

FAUN Publication

How to recover Failed Systemd services automatically

FusionAuth

FusionAuth

Authenticating with AWS Managed Microsoft Active Directory and LDAP

AboutHelpTermsPrivacy


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ashley Gelwix

Ashley Gelwix

XR Developer at HookBang | https://github.com/sitting-duck

More from Medium

omayma korbi

omayma korbi

Everything is an object?!

Sayantan

Sayantan

Print all the possible permutations of a String

Aphrotee

Aphrotee

Algorithm That Converts Roman Numerals into Their Integer Values

Yashraj Dudhatra

Yashraj Dudhatra

Five In-built string functions in C++ that you should know

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Knowable