Linked Questions

1 vote
2 answers
1k views

Possible Duplicate: Convert std::string to const char* or char* Simple question but I'm new to C++. How do I convert a string to a char * (I read a string from cin then I have a function that ...
tree-hacker's user avatar
  • 5,501
0 votes
1 answer
2k views

For an application that I'm writing, I have a string type variable that I want to display within an ncurses window: #include <iostream> #include <ncurses.h> #include <string> int ...
Karthik's user avatar
  • 29
0 votes
1 answer
1k views

I am trying to create a copy of a std::string to a char*. This is my function and its seen result: void main() { std::string test1; std::cout << "Enter Data1" << std::endl; std::cin >&...
BlueBottle's user avatar
-1 votes
1 answer
2k views

because many posts about this problem are misleading or ambiguous, this is how it works, just for the record (tested): How to convert an Arduino C++ String to an ANSI C string (char* array) using the ...
Pirx's user avatar
  • 9
1 vote
2 answers
738 views

I've been trying everything under the sun to do the simple following: 1) Receive an input string from stdin. 2) Convert it to a char pointer so I can pass to a tabling/palindrome finding function. ...
Rome_Leader's user avatar
  • 2,710
-1 votes
1 answer
267 views

It's a simple program for version numbers directories. It fails to compile with this error: no suitable conversion function from "std::string" to "const char *" exists #include &...
HeyProtagonist's user avatar
0 votes
2 answers
436 views

Possible Duplicate: Convert std::string to const char* or char* is there any to get the string back from the stl map and into a char array?? multimap<string, string> testcase; testcase....
Prasanth Madhavan's user avatar
-2 votes
1 answer
207 views

The two functions below are about to implement zip and unzip, but I have problems selecting the correct type buffer to save the string from the file. Also, for char* ptr = line, which is declared a ...
haonan wang's user avatar
0 votes
1 answer
206 views

I got the following errors while compiling, here's the problem part of code. Please help me understand what's wrong? for (std::vector<std::string>::iterator i = files.begin(), end = files.end();...
Nevis Franko's user avatar
-1 votes
1 answer
176 views

I was trying to make a program that can open websites via running a command in the shell. But I get this error: "no suitable conversion function from "std::__1::string" to "const ...
maghje13's user avatar
-2 votes
1 answer
126 views

I want to create sth like: int main () { string s{}; std::cout << "Enter CMD: \n"; getline(cin,s); system(s); } But since I can use only const char on ...
Manni Boxer's user avatar
1 vote
0 answers
119 views

Possible Duplicate: Convert std::string to const char* or char* My code is this #include <iostream> #include <fstream> using namespace std; string mapChange(int side, string oldMap)...
lijrobert's user avatar
  • 145
-2 votes
2 answers
87 views

I am trying to read in an input from a user and I know my method needs a char* but is there anyway to make the input of cin able to be used by that char? (look at the comment at char* x.) string y; ...
Jen's user avatar
  • 255
-2 votes
1 answer
57 views

I wish to make a char with digits between 0-9. The user decides how many digits to use. For example, if the user inputs 4, the char should be 01234. Please note I cannot use the string data type. I ...
Sheru's user avatar
  • 7
0 votes
1 answer
53 views

I am trying to use the std::rename() function to move a .docx file, however, the name of the file may vary. How can I use a std::string within std::rename() so that it does not have to be a hardcoded ...
user avatar

15 30 50 per page
1
2
3 4 5
7