Link to home
Start Free TrialLog in
Avatar of HaniDaher
HaniDaher

asked on

Convert char to const char * c++

How can i convert a char to const char* in c++
When i try to convert it i get this error:
invalid conversion from char to const char *
ASKER CERTIFIED SOLUTION
Avatar of HaniDaher
HaniDaher

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Zoppo
JFI: I would propose to do it directly without creating a copy, that's faster:

string a(1 , str[0]);