Région de recherche :

Date :

https://stackoverflow.com › questions › 9834067

c - Difference between char* and const char*? - Stack Overflow

The principal difference of the 2 in general is that *cname or cname[n] will evaluate to lvalues of type const char, whereas *name or name[n] will evaluate to lvalues of type char, which are modifiable lvalues.

https://stackoverflow.com › questions › 7903551

and when to use const char - Stack Overflow

void withPointer() { const char *sz = "hello"; std::cout << sizeof(sz) << std::endl; } void withArray() { const char sz[] = "hello"; std::cout << sizeof(sz) << std::endl; } will give you very different answers.

https://zestedesavoir.com › tutoriels › 755 › le-langage-c-1 › 1043_aggregats-memoire-et...

Les chaînes de caractères - Le langage C - Zeste de Savoir

Apprenez à manipuler du texte en C avec les chaînes de caractères, des tableaux de char terminés par un caractère nul. Découvrez comment les initialiser, les afficher, les lire et les écrire.

https://www.gnu.org › software › c-intro-and-ref › manual › html_node › const.html

const (GNU C Language Manual)

Learn how to declare and use constant variables and pointers in C with const keyword. See examples of const char * and other pointer types.

https://en.cppreference.com › w › c › language › const

const type qualifier - cppreference.com

Learn how to use the const keyword to declare constant types and expressions in C. See the rules and examples for const-qualified objects, pointers, arrays, functions, and compound literals.

https://en.cppreference.com › w › c › language › character_constant

Character constant - cppreference.com

Learn about the syntax and types of character constants in C and C++, including multicharacter constants with different encodings. Find out how to use escape sequences, universal character names, and wide multicharacter constants.

https://fr.wikipedia.org › wiki › Const

const — Wikipédia

En programmation, dans les langages C ou C++, const est un mot-clé permettant au programmeur de signaler au compilateur que l'élément ainsi qualifié ne doit pas être modifié pendant l'exécution du programme [1]. Cet élément sera donc constant tout le long d'une exécution normale du programme.

https://learn.microsoft.com › fr-fr › cpp › cpp › const-cpp

const (C++) | Microsoft Learn

Apprenez à utiliser la const mot clé en C++ pour déclarer des variables, des pointeurs et des fonctions constantes. Découvrez les différences entre C et C++ en matière de const et les règles de surcharge de fonctions membres.

https://fr.wikiversity.org › wiki › Introduction_au_langage_C › Variables_et_constantes

Introduction au langage C : Variables et constantes

Pour lire une variable sur le flux d'entrée stdin (associé par défaut au clavier), il faut faire appel à la fonction scanf("%d", &variable); (%d est remplacé par : %f pour les nombres réel (float), %s pour les chaines de caractères (char * / char []), %c pour un caractère, etc. )

https://fr.wikiversity.org › wiki › Langage_C++ › Constantes_et_Variables

Langage C++/Constantes et Variables — Wikiversité

//exemple de constante caractère const char c = 'A'; //exemple de constante entière const int i = 2007; Fin de l'exemple Attention : A l'instar des variables, les constantes ne peuvent pas porter n’importe quel nom d'identifiant.