Search
 
SCRIPT & CODE EXAMPLE
 

CPP

qstring to char*

int main(int argc, char **argv)
{
 QApplication app(argc, argv);
  QString str1 = "Test";
  QByteArray ba = str1.toLocal8Bit();
  const char *c_str2 = ba.data();
  printf("str2: %s", c_str2);
  return app.exec();
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: convert vector into array c++ 
Cpp :: freopen c++ 
Cpp :: is C++ useful in 2021 
Cpp :: how to free the vector c++ 
Cpp :: convert string to number c++ 
Cpp :: c++ find largest number in array 
Cpp :: c++ print to standard error 
Cpp :: declare dynamic array c++ 
Cpp :: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools" 
Cpp :: c++ check if string contains uppercase 
Cpp :: maximum value in map in c++ 
Cpp :: how to declare 1-D array in C/C++ 
Cpp :: convert int to string c++ 
Cpp :: c++ code for selection sort 
Cpp :: C++ convert integer to digits, as vector 
Cpp :: c++ merge sort 
Cpp :: change abstract title name latex 
Cpp :: srand() c++ 
Cpp :: array and for loop in c++ 
Cpp :: switch case c++ 
Cpp :: arguments to a class instance c++ 
Cpp :: do while loop c++ loops continuously 
Cpp :: c++ fizzbuzz 
Cpp :: c++ typing animation 
Cpp :: when was c++ created 
Cpp :: count bits c++ 
Cpp :: c++ binary search 
Cpp :: tolower funciton in cpp 
Cpp :: c++ pause linux 
Cpp :: std vector c++ 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =