Linked Questions

0 votes
2 answers
621 views

I've never seen this call to char() as a function before. Where is this described and what does it mean? This usage is part of the example on this cppreference.com community wiki page: https://en....
Gabriel Staples's user avatar
-5 votes
2 answers
3k views

so i just want to convert int in digits and store it in array for eg int n=456; std::string nstr = std::to_string(n); std::cout << nstr[0]; now i just want the length of nstr... whenever i ...
Aadi Manchekar's user avatar
0 votes
4 answers
937 views

The following code works: void CMyPlugin8::myMessageBox(std::string& myString) { myString = "Received the following string\n" + myString; char * writable = new char[myString.size() + 1]; ...
Mickey D's user avatar
  • 347
2 votes
6 answers
769 views

I am working on an assignment for my operating systems class. We have the option of using C or C++, so I decided to use C++ since I practised it on the job a bit more recently than C. I will need to ...
Callum C's user avatar
0 votes
2 answers
2k views

I have a vector of strings which are changing its contents for no apparent reason. Can't really explain what is going on. Sorry for a long listing, but it's really bugging me. I have a GUI ...
jaho's user avatar
  • 5,042
0 votes
4 answers
2k views

this post bases on the solution given here, a post on SO I write a function to get a given file extension (string type), something like: void GetFileExtension(string filename, char* extension) { ...
TSL_'s user avatar
  • 2,099
-2 votes
2 answers
1k views

I am looking to make a C++ function that has the following prototype: char *trim(char *string) What I want this function to do is the following: Trim all the non, alphabetic, numeric characters If ...
ZioN's user avatar
  • 560
-4 votes
1 answer
2k views

Im getting these errors because i cant convert correctly const char* to std::string.... In file included from ./../Header Files/MainGame.h:5:0, from ./MainGame.cpp:2, ...
John Doe's user avatar
-4 votes
2 answers
3k views

I have an iterator of type: std::map<int, std::string>::const_iterator and as you can see the map is storing std::strings. I am trying to extract a value using: x.second.c_str() and pass it ...
user997112's user avatar
  • 31.1k
1 vote
2 answers
584 views

I have multiple methods inside my class which need const char * so I convert string to const char * inside the constructor of my class and store it in a local variable with type const char *. The ...
eSadr's user avatar
  • 425
1 vote
2 answers
1k views

I converted a narrow string to the wide string as follows : string nameOfPrinter; getline( cin , nameOfPrinter ); wstring WprinterName; int number = MultiByteToWideChar( CP_UTF8 , 0 , nameOfPrinter....
Suhail Gupta's user avatar
  • 23.4k
-3 votes
4 answers
1k views

Is it legal to modify the result of std::string::op[]? I would like to swap the contents of char* and std::string and could not do it. After going through the above link, I'm still unable to get the ...
Jagannath's user avatar
  • 4,025
1 vote
5 answers
990 views

I am trying to write a function to convert a std::string to char* . The first one I have written was this: char* $ (string str) { char* cstr; const unsigned int length=str.size(); cstr=...
Ramy Al Zuhouri's user avatar
0 votes
1 answer
1k views

I'm implementing a system that uses libcrafter and crypto++ to transmit specific frames on the network. But the problem I'm stuck with isn't at this level at all. It's about conversion between types ...
3isenHeim's user avatar
  • 243
1 vote
4 answers
431 views

Is there anything bad about the following code? Although it runs fine, but should I have allocated a memory to the character pointer first before initializing it? const char *a; string  b; getline(...
Vishal Sharma's user avatar

15 30 50 per page
1
3 4
5
6 7