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 › 890535

c - What is the difference between char * const and const char ...

The difference is that const char * is a pointer to a const char, while char * const is a constant pointer to a char. The first, the value being pointed to can't be changed but the pointer can be. The second, the value being pointed at can change but the pointer can't (similar to a reference).

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

Lire et écrire depuis et dans une chaîne de caractères. Les classes de caractères. Exercices. Qu'est-ce qu'une chaîne de caractères ?

https://yard.onl › sitelycee › cours › c › Fonctionsdemanipulationdeschanes.html

Fonctions de manipulation des chaînes - Cours de programmation en ...

Le const (qui signifie constante, rappelez-vous) fait que la fonction strlen « s'interdit » en quelque sorte de modifier votre chaîne. Quand vous voyez un const, vous savez que la variable n'est pas modifiée par la fonction, elle est juste lue. Testons la fonction strlen : int main(int argc, char *argv []) { char chaine [] = "Salut";

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

const (GNU C Language Manual)

Using const char * for the parameter is a way of saying this function never modifies the memory of the string itself. In calling string_length , you can specify an ordinary char * since that can be converted automatically to const char * .

https://www.geeksforgeeks.org › constants-in-c

Constants in C - GeeksforGeeks

We define a constant in C language using the const keyword. Also known as a const type qualifier, the const keyword is placed at the start of the variable declaration to declare that variable as a constant.

Constants in C - GeeksforGeeks

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

const type qualifier - cppreference.com

const type qualifier. Each individual type in the C type system has several qualified versions of that type, corresponding to one, two, or all three of the const, volatile, and, for pointers to object types, restrict qualifiers. This page describes the effects of the const qualifier.

https://openclassrooms.com › fr › courses › 19980-apprenez-a-programmer-en-c › 7672681...

Apprenez à programmer en C - OpenClassrooms

La fonction prend un paramètre de type const char* . Le const( qui signifie constante) fait que la fonction strlen "s'interdit" en quelque sorte de modifier votre chaîne. Quand vous voyez un const , vous savez que la variable n'est pas modifiée par la fonction, elle est juste lue.

Apprenez à programmer en C - OpenClassrooms

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://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. )