Considérez le code suivant: const char foo[] = "lorem ipsum"; // foo is an array of 12 characters
const auto length = strlen(foo); // length is 11
string bar(length, '\0'); // bar was ...
Je suis nouveau en programmation et très nouveau en C ++, et je suis récemment tombé sur des chaînes.
Pourquoi avons-nous besoin d'un terminateur nul à l ...
Je crée un programme dans lequel j'ai besoin d'utiliser une fonction qui stocke un jeton d'une chaîne dans un vecteur. La fonction ne fonctionnait pas correctement, j'ai donc essay&ea ...
int main(int argc, char *argv[])
{
char string[100];
string = *argv[1];
}
Why doesn't this work? Do I actually need to use loops to iterate through each element and do everything the long ...