What's the difference between std::string and const char*? consider following example
#include <iostream>
int main()
{
const char* myName1{ "Alex" };
std::cout << myName1 << '\n';
char myName2[]{ "Alex" };
std::cout << myName2 << '\n';
return 0;
}
are they the same?
Aucun commentaire:
Enregistrer un commentaire